linux/kernel/rcu
Paul E. McKenney fd796e4139 rcu-tasks: Use fewer callbacks queues if callback flood ends
By default, when lock contention is encountered, the RCU Tasks flavors
of RCU switch to using per-CPU queueing.  However, if the callback
flood ends, per-CPU queueing continues to be used, which introduces
significant additional overhead, especially for callback invocation,
which fans out a series of workqueue handlers.

This commit therefore switches back to single-queue operation if at the
beginning of a grace period there are very few callbacks.  The definition
of "very few" is set by the rcupdate.rcu_task_collapse_lim module
parameter, which defaults to 10.  This switch happens in two phases,
with the first phase causing future callbacks to be enqueued on CPU 0's
queue, but with all queues continuing to be checked for grace periods
and callback invocation.  The second phase checks to see if an RCU grace
period has elapsed and if all remaining RCU-Tasks callbacks are queued
on CPU 0.  If so, only CPU 0 is checked for future grace periods and
callback operation.

Of course, the return of contention anywhere during this process will
result in returning to per-CPU callback queueing.

Reported-by: Martin Lau <kafai@fb.com>
Cc: Neeraj Upadhyay <neeraj.iitr10@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-12-09 10:52:11 -08:00
..
Kconfig rcu_tasks: Convert bespoke callback list to rcu_segcblist structure 2021-12-07 16:26:57 -08:00
Kconfig.debug rcu: Restrict RCU_STRICT_GRACE_PERIOD to at most four CPUs 2021-05-10 16:22:54 -07:00
Makefile rcuperf: Change rcuperf to rcuscale 2020-08-24 18:39:24 -07:00
rcu_segcblist.c rcu/nocb: Remove stale comment above rcu_segcblist_offload() 2021-03-15 13:54:54 -07:00
rcu_segcblist.h rcu/nocb: Code-style nits in callback-offloading toggling 2021-01-06 16:47:55 -08:00
rcu.h Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00
rcuscale.c rcuscale: Warn on individual rcu_scale_init() error conditions 2021-09-13 16:36:16 -07:00
rcutorture.c Merge branches 'fixes.2021.10.07a', 'scftorture.2021.09.16a', 'tasks.2021.09.15a', 'torture.2021.09.13b' and 'torturescript.2021.09.16a' into HEAD 2021-10-07 10:02:17 -07:00
refscale.c refscale: Warn on individual ref_scale_init() error conditions 2021-09-13 16:36:16 -07:00
srcutiny.c srcutiny: Mark read-side data races 2021-08-06 13:41:48 -07:00
srcutree.c Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00
sync.c rcu: Fix various typos in comments 2021-05-12 12:11:05 -07:00
tasks.h rcu-tasks: Use fewer callbacks queues if callback flood ends 2021-12-09 10:52:11 -08:00
tiny.c srcu: Initialize SRCU after timers 2021-05-10 16:03:35 -07:00
tree_exp.h rcu: Fix existing exp request check in sync_sched_exp_online_cleanup() 2021-09-13 16:32:46 -07:00
tree_nocb.h rcu-nocb: Fix a couple of tree_nocb code-style nits 2021-09-13 16:32:45 -07:00
tree_plugin.h rcu: Always inline rcu_dynticks_task*_{enter,exit}() 2021-10-07 09:59:41 -07:00
tree_stall.h sched,rcu: Rework try_invoke_on_locked_down_task() 2021-10-07 13:51:15 +02:00
tree.c rcu: Fix rcu_dynticks_curr_cpu_in_eqs() vs noinstr 2021-10-07 10:00:07 -07:00
tree.h Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00
update.c RCU pull request for v5.16 2021-11-01 20:25:38 -07:00