Centos-kernel-stream-9/kernel/rcu
Waiman Long 65e2702499 rcu: Restrict access to RCU CPU stall notifiers
JIRA: https://issues.redhat.com/browse/RHEL-34076

commit 4e58aaeebb3c27993c734c99eae6881b196b1ddb
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Wed, 1 Nov 2023 18:28:38 -0700

    rcu: Restrict access to RCU CPU stall notifiers

    Although the RCU CPU stall notifiers can be useful for dumping state when
    tracking down delicate forward-progress bugs where NUMA effects cause
    cache lines to be delivered to a given CPU regularly, but always in a
    state that prevents that CPU from making forward progress.  These bugs can
    be detected by the RCU CPU stall-warning mechanism, but in some cases,
    the stall-warnings printk()s disrupt the forward-progress bug before
    any useful state can be obtained.

    Unfortunately, the notifier mechanism added by commit 5b404fdabacf ("rcu:
    Add RCU CPU stall notifier") can make matters worse if used at all
    carelessly. For example, if the stall warning was caused by a lock not
    being released, then any attempt to acquire that lock in the notifier
    will hang. This will prevent not only the notifier from producing any
    useful output, but it will also prevent the stall-warning message from
    ever appearing.

    This commit therefore hides this new RCU CPU stall notifier
    mechanism under a new RCU_CPU_STALL_NOTIFIER Kconfig option that
    depends on both DEBUG_KERNEL and RCU_EXPERT.  In addition, the
    rcupdate.rcu_cpu_stall_notifiers=1 kernel boot parameter must also
    be specified.  The RCU_CPU_STALL_NOTIFIER Kconfig option's help text
    contains a warning and explains the dangers of careless use, recommending
    lockless notifier code.  In addition, a WARN() is triggered each time
    that an attempt is made to register a stall-warning notifier in kernels
    built with CONFIG_RCU_CPU_STALL_NOTIFIER=y.

    This combination of measures will keep use of this mechanism confined to
    debug kernels and away from routine deployments.

    [ paulmck: Apply Dan Carpenter feedback. ]

    Fixes: 5b404fdabacf ("rcu: Add RCU CPU stall notifier")
    Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
    Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
    Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>

Signed-off-by: Waiman Long <longman@redhat.com>
2024-05-31 10:56:18 -04:00
..
Kconfig rcu: Employ jiffies-based backstop to callback time limit 2024-05-31 10:56:12 -04:00
Kconfig.debug rcu: Restrict access to RCU CPU stall notifiers 2024-05-31 10:56:18 -04:00
Makefile rcuperf: Change rcuperf to rcuscale 2020-08-24 18:39:24 -07:00
rcu.h rcu: Restrict access to RCU CPU stall notifiers 2024-05-31 10:56:18 -04:00
rcu_segcblist.c rcu: Use rcu_segcblist_segempty() instead of open coding it 2024-05-31 10:56:17 -04:00
rcu_segcblist.h rcu: Throttle callback invocation based on number of ready callbacks 2023-09-22 13:21:21 -04:00
rcuscale.c rcuscale: Move rcu_scale_writer() schedule_timeout_uninterruptible() to _idle() 2024-05-31 10:56:15 -04:00
rcutorture.c rcu: Restrict access to RCU CPU stall notifiers 2024-05-31 10:56:18 -04:00
refscale.c refscale: Print out additional module parameters 2024-05-31 10:56:17 -04:00
srcutiny.c rcu: Dump memory object info if callback function is invalid 2024-05-31 10:56:16 -04:00
srcutree.c srcu: Only accelerate on enqueue time 2024-05-31 10:56:17 -04:00
sync.c rcu/sync: Use call_rcu_hurry() instead of call_rcu 2023-09-22 13:21:17 -04:00
tasks.h rcu-tasks: Make rcu_tasks_lazy_ms static 2024-05-31 10:56:18 -04:00
tiny.c rcu: Dump memory object info if callback function is invalid 2024-05-31 10:56:16 -04:00
tree.c rcu/exp: Handle RCU expedited grace period kworker allocation failure 2024-05-31 10:56:18 -04:00
tree.h rcu/tree: Defer setting of jiffies during stall reset 2024-05-31 10:56:18 -04:00
tree_exp.h rcu: Add RCU CPU stall notifier 2024-05-31 10:56:18 -04:00
tree_nocb.h rcu: Make the rcu_nocb_poll boot parameter usable via boot config 2024-05-31 10:56:14 -04:00
tree_plugin.h rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp 2024-05-31 10:56:12 -04:00
tree_stall.h rcu: Restrict access to RCU CPU stall notifiers 2024-05-31 10:56:18 -04:00
update.c rcu: Restrict access to RCU CPU stall notifiers 2024-05-31 10:56:18 -04:00