BPF List
 help / color / mirror / Atom feed
* [PATCH rcu 0/17] SRCU updates, including SRCU-fast
@ 2025-01-16 20:21 Paul E. McKenney
  2025-01-16 20:20 ` [PATCH rcu 01/17] srcu: Make Tiny SRCU able to operate in preemptible kernels Paul E. McKenney
                   ` (15 more replies)
  0 siblings, 16 replies; 42+ messages in thread
From: Paul E. McKenney @ 2025-01-16 20:21 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, kernel-team, rostedt, ast, andrii, peterz,
	kent.overstreet, bpf

Hello!

This series contains SRCU updates, perhaps most notably the addition of
srcu_read_lock_fast() and srcu_read_unlock_fast(), which on my laptop are
about 20% faster than rcu_read_lock_trace() and rcu_read_unlock_trace().
There are of course drawbacks:

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.

Whether or not this can replace RCU Tasks Trace, it should replace the
SRCU-lite API, where the only drawback is a pointer-sized return value
from srcu_read_lock_fast() compared to the int-sized return value from
srcu_read_lock_lite().  And yes, I should have thought harder before
doing that SRCU-lite...

The series is as follows:

1.	Make Tiny SRCU able to operate in preemptible kernels.

2.	Define SRCU_READ_FLAVOR_ALL in terms of symbols.

3.	Use ->srcu_gp_seq for rcutorture reader batch.

4.	Pull ->srcu_{un,}lock_count into a new srcu_ctr structure.

5.	Make SRCU readers use ->srcu_ctrs for counter selection.

6.	Make Tree SRCU updates independent of ->srcu_idx.

7.	Force synchronization for srcu_get_delay().

8.	Rename srcu_check_read_flavor_lite() to
	srcu_check_read_flavor_force().

9.	Add SRCU_READ_FLAVOR_SLOWGP to flag need for synchronize_rcu().

10.	Pull pointer-to-integer conversion into __srcu_ptr_to_ctr().

11.	Pull integer-to-pointer conversion into __srcu_ctr_to_ptr().

12.	Move SRCU Tree/Tiny definitions from srcu.h.

13.	Add SRCU-fast readers.

14.	Add ability to test srcu_read_{,un}lock_fast().

15.	Add srcu_read_lock_fast() support using "srcu-fast".

16.	Make scenario SRCU-P use srcu_read_lock_fast().

17.	Fix srcu_read_unlock_{lite,nmisafe}() kernel-doc.

						Thanx, Paul

------------------------------------------------------------------------

 b/include/linux/srcu.h                                       |    3 
 b/include/linux/srcutiny.h                                   |    2 
 b/include/linux/srcutree.h                                   |   13 
 b/kernel/rcu/rcu.h                                           |    9 
 b/kernel/rcu/rcutorture.c                                    |    2 
 b/kernel/rcu/refscale.c                                      |   32 +
 b/kernel/rcu/srcutiny.c                                      |    6 
 b/kernel/rcu/srcutree.c                                      |    2 
 b/tools/testing/selftests/rcutorture/configs/rcu/SRCU-P.boot |    1 
 include/linux/srcu.h                                         |   66 ++-
 include/linux/srcutiny.h                                     |   25 +
 include/linux/srcutree.h                                     |   77 +++
 kernel/rcu/rcutorture.c                                      |    9 
 kernel/rcu/srcutree.c                                        |  233 +++++------
 14 files changed, 332 insertions(+), 148 deletions(-)

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2025-01-30 19:03 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 20:21 [PATCH rcu 0/17] SRCU updates, including SRCU-fast Paul E. McKenney
2025-01-16 20:20 ` [PATCH rcu 01/17] srcu: Make Tiny SRCU able to operate in preemptible kernels Paul E. McKenney
2025-01-16 20:20 ` [PATCH rcu 02/17] srcu: Define SRCU_READ_FLAVOR_ALL in terms of symbols Paul E. McKenney
2025-01-16 20:20 ` [PATCH rcu 03/17] srcu: Use ->srcu_gp_seq for rcutorture reader batch Paul E. McKenney
2025-01-16 20:20 ` [PATCH rcu 04/17] srcu: Pull ->srcu_{un,}lock_count into a new srcu_ctr structure Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 05/17] srcu: Make SRCU readers use ->srcu_ctrs for counter selection Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 06/17] srcu: Make Tree SRCU updates independent of ->srcu_idx Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 07/17] srcu: Force synchronization for srcu_get_delay() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 08/17] srcu: Rename srcu_check_read_flavor_lite() to srcu_check_read_flavor_force() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 09/17] srcu: Add SRCU_READ_FLAVOR_SLOWGP to flag need for synchronize_rcu() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 10/17] srcu: Pull pointer-to-integer conversion into __srcu_ptr_to_ctr() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 11/17] srcu: Pull integer-to-pointer conversion into __srcu_ctr_to_ptr() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 12/17] srcu: Move SRCU Tree/Tiny definitions from srcu.h Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 13/17] srcu: Add SRCU-fast readers Paul E. McKenney
2025-01-16 21:00   ` Alexei Starovoitov
2025-01-16 21:38     ` Peter Zijlstra
2025-01-16 21:55     ` Paul E. McKenney
2025-01-16 22:58       ` Alexei Starovoitov
2025-01-16 21:52   ` Andrii Nakryiko
2025-01-16 22:54     ` Paul E. McKenney
2025-01-16 22:57       ` Andrii Nakryiko
2025-01-17  0:07         ` Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 14/17] rcutorture: Add ability to test srcu_read_{,un}lock_fast() Paul E. McKenney
2025-01-16 20:21 ` [PATCH rcu 15/17] refscale: Add srcu_read_lock_fast() support using "srcu-fast" Paul E. McKenney
2025-01-30 19:03 ` [PATCH rcu 0/17] SRCU updates, including SRCU-fast Paul E. McKenney
2025-01-30 19:02   ` [PATCH rcu v2] 01/20] srcu: Make Tiny SRCU able to operate in preemptible kernels Paul E. McKenney
2025-01-30 19:02   ` [PATCH rcu v2] 02/20] srcu: Define SRCU_READ_FLAVOR_ALL in terms of symbols Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 03/20] srcu: Use ->srcu_gp_seq for rcutorture reader batch Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 04/20] srcu: Pull ->srcu_{un,}lock_count into a new srcu_ctr structure Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 05/20] srcu: Make SRCU readers use ->srcu_ctrs for counter selection Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 06/20] srcu: Make Tree SRCU updates independent of ->srcu_idx Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 07/20] srcu: Force synchronization for srcu_get_delay() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 08/20] srcu: Rename srcu_check_read_flavor_lite() to srcu_check_read_flavor_force() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 09/20] srcu: Add SRCU_READ_FLAVOR_SLOWGP to flag need for synchronize_rcu() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 10/20] srcu: Pull pointer-to-integer conversion into __srcu_ptr_to_ctr() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 11/20] srcu: Pull integer-to-pointer conversion into __srcu_ctr_to_ptr() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 12/20] srcu: Move SRCU Tree/Tiny definitions from srcu.h Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 13/20] srcu: Add SRCU-fast readers Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 14/20] rcutorture: Add ability to test srcu_read_{,un}lock_fast() Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 15/20] refscale: Add srcu_read_lock_fast() support using "srcu-fast" Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 18/20] srcu: Document that srcu_{read_lock,down_read}() can share srcu_struct Paul E. McKenney
2025-01-30 19:03   ` [PATCH rcu v2] 19/20] srcu: Add srcu_down_read_fast() and srcu_up_read_fast() Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox