diff options
| author | Paul E. McKenney <[email protected]> | 2025-01-09 21:19:42 +0000 |
|---|---|---|
| committer | Boqun Feng <[email protected]> | 2025-02-05 15:12:05 +0000 |
| commit | c4020620528e4e22a051900654a70dcff0ab218d (patch) | |
| tree | 2ed55f6aa4118d7282a65113aa5282c37ef6315c /tools/perf/scripts/python/mem-phys-addr.py | |
| parent | srcu: Move SRCU Tree/Tiny definitions from srcu.h (diff) | |
| download | kernel-c4020620528e4e22a051900654a70dcff0ab218d.tar.gz kernel-c4020620528e4e22a051900654a70dcff0ab218d.zip | |
srcu: Add SRCU-fast readers
This commit adds srcu_read_{,un}lock_fast(), which is similar
to srcu_read_{,un}lock_lite(), but avoids the array-indexing and
pointer-following overhead. On a microbenchmark featuring tight
loops around empty readers, this results in about a 20% speedup
compared to RCU Tasks Trace on my x86 laptop.
Please note that SRCU-fast has drawbacks compared to RCU Tasks
Trace, including:
o Lack of CPU stall warnings.
o SRCU-fast readers permitted only where rcu_is_watching().
o A pointer-sized return value from srcu_read_lock_fast() must
be passed to the corresponding srcu_read_unlock_fast().
o In the absence of readers, a synchronize_srcu() having _fast()
readers will incur the latency of at least two normal RCU grace
periods.
o RCU Tasks Trace priority boosting could be easily added.
Boosting SRCU readers is more difficult.
SRCU-fast also has a drawback compared to SRCU-lite, namely that the
return value from srcu_read_lock_fast()-fast is a 64-bit pointer and
that from srcu_read_lock_lite() is only a 32-bit int.
[ paulmck: Apply feedback from Akira Yokosawa. ]
Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Kent Overstreet <[email protected]>
Cc: <[email protected]>
Signed-off-by: Boqun Feng <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions
