BPF List
 help / color / mirror / Atom feed
* [PATCH rcu 0/11] Add light-weight readers for SRCU
@ 2024-09-03 16:32 Paul E. McKenney
  2024-09-03 16:33 ` [PATCH rcu 01/11] srcu: Rename srcu_might_be_idle() to srcu_should_expedite() Paul E. McKenney
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Paul E. McKenney @ 2024-09-03 16:32 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, kernel-team, rostedt, Alexei Starovoitov,
	Andrii Nakryiko, Peter Zijlstra, Kent Overstreet, bpf

Hello!

This series provides light-weight readers for SRCU.  This lightness
is selected by the caller by using the new srcu_read_lock_lite() and
srcu_read_unlock_lite() flavors instead of the usual srcu_read_lock() and
srcu_read_unlock() flavors.  Although this passes significant rcutorture
testing, this should still be considered to be experimental.

There are a few restrictions:  (1) If srcu_read_lock_lite() is called
on a given srcu_struct structure, then no other flavor may be used on
that srcu_struct structure, before, during, or after.  (2) The _lite()
readers may only be invoked from regions of code where RCU is watching
(as in those regions in which rcu_is_watching() returns true).  (3)
There is no auto-expediting for srcu_struct structures that have
been passed to _lite() readers.  (4) SRCU grace periods for _lite()
srcu_struct structures invoke synchronize_rcu() at least twice, thus
having longer latencies than their non-_lite() counterparts.  (5) Even
with synchronize_srcu_expedited(), the resulting SRCU grace period
will invoke synchronize_rcu() at least twice, as opposed to invoking
the IPI-happy synchronize_rcu_expedited() function.  (6)  Just as with
srcu_read_lock() and srcu_read_unlock(), the srcu_read_lock_lite() and
srcu_read_unlock_lite() functions may not (repeat, *not*) be invoked
from NMI handlers (that is what the _nmisafe() interface are for).
Although one could imagine readers that were both _lite() and _nmisafe(),
one might also imagine that the read-modify-write atomic operations that
are needed by any NMI-safe SRCU read marker would make this unhelpful
from a performance perspective.

All that said, the patches in this series are as follows:

1.	Rename srcu_might_be_idle() to srcu_should_expedite().

2.	Introduce srcu_gp_is_expedited() helper function.

3.	Renaming in preparation for additional reader flavor.

4.	Bit manipulation changes for additional reader flavor.

5.	Standardize srcu_data pointers to "sdp" and similar.

6.	Convert srcu_data ->srcu_reader_flavor to bit field.

7.	Add srcu_read_lock_lite() and srcu_read_unlock_lite().

8.	rcutorture: Expand RCUTORTURE_RDR_MASK_[12] to eight bits.

9.	rcutorture: Add reader_flavor parameter for SRCU readers.

10.	rcutorture: Add srcu_read_lock_lite() support to
	rcutorture.reader_flavor.

11.	refscale: Add srcu_read_lock_lite() support using "srcu-lite".

						Thanx, Paul

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

 Documentation/admin-guide/kernel-parameters.txt   |    4 
 b/Documentation/admin-guide/kernel-parameters.txt |    8 +
 b/include/linux/srcu.h                            |   21 +-
 b/include/linux/srcutree.h                        |    2 
 b/kernel/rcu/rcutorture.c                         |   28 +--
 b/kernel/rcu/refscale.c                           |   54 +++++--
 b/kernel/rcu/srcutree.c                           |   16 +-
 include/linux/srcu.h                              |   86 +++++++++--
 include/linux/srcutree.h                          |    5 
 kernel/rcu/rcutorture.c                           |   37 +++-
 kernel/rcu/srcutree.c                             |  168 +++++++++++++++-------
 11 files changed, 308 insertions(+), 121 deletions(-)

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

end of thread, other threads:[~2024-10-03 16:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 16:32 [PATCH rcu 0/11] Add light-weight readers for SRCU Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 01/11] srcu: Rename srcu_might_be_idle() to srcu_should_expedite() Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 02/11] srcu: Introduce srcu_gp_is_expedited() helper function Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 03/11] srcu: Renaming in preparation for additional reader flavor Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 04/11] srcu: Bit manipulation changes " Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 05/11] srcu: Standardize srcu_data pointers to "sdp" and similar Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 06/11] srcu: Convert srcu_data ->srcu_reader_flavor to bit field Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 07/11] srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite() Paul E. McKenney
2024-09-03 19:45   ` Alexei Starovoitov
2024-09-03 22:10     ` Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 08/11] rcutorture: Expand RCUTORTURE_RDR_MASK_[12] to eight bits Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 09/11] rcutorture: Add reader_flavor parameter for SRCU readers Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 10/11] rcutorture: Add srcu_read_lock_lite() support to rcutorture.reader_flavor Paul E. McKenney
2024-09-03 16:33 ` [PATCH rcu 11/11] refscale: Add srcu_read_lock_lite() support using "srcu-lite" Paul E. McKenney
2024-09-03 21:38 ` [PATCH rcu 0/11] Add light-weight readers for SRCU Kent Overstreet
2024-09-03 22:13   ` Paul E. McKenney
2024-09-03 23:03     ` Kent Overstreet
2024-09-04 10:54       ` Paul E. McKenney
2024-09-03 22:08 ` Andrii Nakryiko
2024-09-03 22:20   ` Paul E. McKenney
2024-10-02 19:59   ` Andrii Nakryiko
2024-10-03 16:09     ` Paul E. McKenney
2024-09-04 16:52 ` [PATCH rcu [12/11] srcu: Allow inlining of __srcu_read_{,un}lock_lite() 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