Skip to content

Add strict short-grace-period Kconfig option

Paul E. McKenney lkml rcu 1 version In review

Get series with b4
b4 am 20200812225632.GA19759@paulmck-ThinkPad-P72

Versions newest first

  1. v1 Latest12 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12rcu: Add Kconfig option for strict RCU grace periodskernel/rcu/Kconfig.debug kernel/rcu/tree_plugin.h+17 -00 replies
2/12rcu: Reduce leaf fanout for strict RCU grace periodskernel/rcu/Kconfig+5 -30 replies
3/12rcu: Restrict default jiffies_till_first_fqs for strict RCU GPskernel/rcu/tree.c+1 -10 replies
4/12rcu: Force DEFAULT_RCU_BLIMIT to 1000 for strict RCU GPskernel/rcu/tree.c+7 -60 replies
5/12rcu: Always set .need_qs from __rcu_read_lock() for strict GPskernel/rcu/tree_plugin.h+2 -00 replies
6/12rcu: Do full report for .need_qs for strict GPskernel/rcu/tree_plugin.h+6 -22 replies
7/12rcu: Attempt QS when CPU discovers GP for strict GPskernel/rcu/tree.c+14 -00 replies
8/12rcu: IPI all CPUs at GP start for strict GPskernel/rcu/tree.c+13 -00 replies
9/12rcu: IPI all CPUs at GP end for strict GPskernel/rcu/tree.c+4 -00 replies
10/12rcu: Provide optional RCU-reader exit delay for strict GPsDocumentation/admin-guide/kernel-parameters.txt kernel/rcu/tree_plugin.h+19 -20 replies
11/12rcu: Execute RCU reader shortly after rcu_core for strict GPskernel/rcu/tree.c kernel/rcu/tree.h+14 -00 replies
12/12rcu: Report QS for outermost PREEMPT=n rcu_read_unlock() for strict GPsinclude/linux/rcupdate.h kernel/rcu/tree.c kernel/rcu/tree_plugin.h+30 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH tip/core/rcu 0/12] Add strict short-grace-period Kconfig option

Hello!

This series adds a CONFIG_RCU_STRICT_GRACE_PERIOD Kconfig option that causes RCU to strive for short grace periods even at great expense in terms of performance, scalability, and real-time response. This option is therefore not for production use, but rather to allow tools such as KASAN to more readily detect pointer leaks from RCU read-side critical sections. Here is an example of such a pointer leak:

	rcu_read_lock();
	p = rcu_dereference(gp);
	do_something(p);
	rcu_read_unlock(); // *p might be freed immediately!
	do_something_else(p); // Potential use after free BUG!!!

This series also adds a rcutree.rcu_unlock_delay kernel boot parameter that delays the specified number of microseconds after the outermost rcu_read_unlock() in an attempt to further bend the odds in KASAN's favor.

The patches in this series are as follows:

1. Add Kconfig option for strict RCU grace periods.

2. Reduce leaf fanout for strict RCU grace periods.

3. Restrict default jiffies_till_first_fqs for strict RCU GPs.

4. Force DEFAULT_RCU_BLIMIT to 1000 for strict RCU GPs.

5. Always set .need_qs from __rcu_read_lock() for strict GPs.

6. Do full report for .need_qs for strict GPs.

7. Attempt QS when CPU discovers GP for strict GPs.

8. IPI all CPUs at GP start for strict GPs.

9. IPI all CPUs at GP end for strict GPs.

10. Provide optional RCU-reader exit delay for strict GPs.

11. Execute RCU reader shortly after rcu_core for strict GPs.

12. Report QS for outermost PREEMPT=n rcu_read_unlock() for strict GPs.

Thanx, Paul

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

 Documentation/admin-guide/kernel-parameters.txt |    9 +++
 include/linux/rcupdate.h                        |    7 ++
 kernel/rcu/Kconfig                              |    8 +-
 kernel/rcu/Kconfig.debug                        |   15 +++++
 kernel/rcu/tree.c                               |   65 +++++++++++++++++++++---
 kernel/rcu/tree.h                               |    1 
 kernel/rcu/tree_plugin.h                        |   47 +++++++++++++----
 7 files changed, 132 insertions(+), 20 deletions(-)