2022-06-20 22:22:03

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH rcu 0/3] Documentation updates for v5.20

Hello!

This series contains a few documentation updates:

1. Update rcutorture.fwd_progress help text.

2. Document the rcutree.rcu_divisor kernel boot parameter.

3. Document rcutree.nocb_nobypass_lim_per_jiffy kernel parameter.

Thanx, Paul

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

Documentation/admin-guide/kernel-parameters.txt | 13 +++++
b/Documentation/admin-guide/kernel-parameters.txt | 15 ++++++
b/kernel/rcu/rcutorture.c | 53 +++++++---------------
3 files changed, 46 insertions(+), 35 deletions(-)


2022-06-20 22:22:04

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH rcu 2/3] doc: Document the rcutree.rcu_divisor kernel boot parameter

This commit adds kernel-parameters.txt documentation for the
rcutree.rcu_divisor kernel boot parameter, which controls the softirq
callback-invocation batch limit.

Cc: Eric Dumazet <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
---
Documentation/admin-guide/kernel-parameters.txt | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 2522b11e593f2..bdf431bdbfdc4 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4666,6 +4666,21 @@
When RCU_NOCB_CPU is set, also adjust the
priority of NOCB callback kthreads.

+ rcutree.rcu_divisor= [KNL]
+ Set the shift-right count to use to compute
+ the callback-invocation batch limit bl from
+ the number of callbacks queued on this CPU.
+ The result will be bounded below by the value of
+ the rcutree.blimit kernel parameter. Every bl
+ callbacks, the softirq handler will exit in
+ order to allow the CPU to do other work.
+
+ Please note that this callback-invocation batch
+ limit applies only to non-offloaded callback
+ invocation. Offloaded callbacks are instead
+ invoked in the context of an rcuoc kthread, which
+ scheduler will preempt as it does any other task.
+
rcutree.rcu_nocb_gp_stride= [KNL]
Set the number of NOCB callback kthreads in
each group, which defaults to the square root
--
2.31.1.189.g2e36527f23

2022-06-20 22:22:11

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH rcu 3/3] doc: Document rcutree.nocb_nobypass_lim_per_jiffy kernel parameter

This commit provides documentation for the kernel parameter controlling
RCU's handling of callback floods on offloaded (rcu_nocbs) CPUs.
This parameter might be obscure, but it is always there when you need it.

Reported-by: Frederic Weisbecker <[email protected]>
Reported-by: Uladzislau Rezki <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
---
Documentation/admin-guide/kernel-parameters.txt | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index bdf431bdbfdc4..a30890141b1a5 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4681,6 +4681,19 @@
invoked in the context of an rcuoc kthread, which
scheduler will preempt as it does any other task.

+ rcutree.nocb_nobypass_lim_per_jiffy= [KNL]
+ On callback-offloaded (rcu_nocbs) CPUs,
+ RCU reduces the lock contention that would
+ otherwise be caused callback floods through
+ use of the ->nocb_bypass list. However, in the
+ common non-flooded case, RCU queues directly to
+ the main ->cblist in order to avoid the extra
+ overhead of the ->nocb_bypass list and its lock.
+ But if there are too many callbacks queued during
+ a single jiffy, RCU pre-queues the callbacks into
+ the ->nocb_bypass queue. The definition of "too
+ many" is supplied by this kernel boot parameter.
+
rcutree.rcu_nocb_gp_stride= [KNL]
Set the number of NOCB callback kthreads in
each group, which defaults to the square root
--
2.31.1.189.g2e36527f23

2022-06-20 22:33:22

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH rcu 1/3] rcutorture: Update rcutorture.fwd_progress help text

This commit updates the rcutorture.fwd_progress help text to say that
it is the number of forward-progress kthreads to spawn rather than the
old enable/disable functionality. While in the area, make the list of
torture-test parameters easier to read by taking advantage of 100 columns.

Signed-off-by: Paul E. McKenney <[email protected]>
---
kernel/rcu/rcutorture.c | 53 ++++++++++++++---------------------------
1 file changed, 18 insertions(+), 35 deletions(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 7120165a93426..6f47d1490c4f5 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -75,62 +75,45 @@ MODULE_AUTHOR("Paul E. McKenney <[email protected]> and Josh Triplett <josh@

torture_param(int, extendables, RCUTORTURE_MAX_EXTEND,
"Extend readers by disabling bh (1), irqs (2), or preempt (4)");
-torture_param(int, fqs_duration, 0,
- "Duration of fqs bursts (us), 0 to disable");
+torture_param(int, fqs_duration, 0, "Duration of fqs bursts (us), 0 to disable");
torture_param(int, fqs_holdoff, 0, "Holdoff time within fqs bursts (us)");
torture_param(int, fqs_stutter, 3, "Wait time between fqs bursts (s)");
-torture_param(int, fwd_progress, 1, "Test grace-period forward progress");
+torture_param(int, fwd_progress, 1, "Number of grace-period forward progress tasks (0 to disable)");
torture_param(int, fwd_progress_div, 4, "Fraction of CPU stall to wait");
-torture_param(int, fwd_progress_holdoff, 60,
- "Time between forward-progress tests (s)");
-torture_param(bool, fwd_progress_need_resched, 1,
- "Hide cond_resched() behind need_resched()");
+torture_param(int, fwd_progress_holdoff, 60, "Time between forward-progress tests (s)");
+torture_param(bool, fwd_progress_need_resched, 1, "Hide cond_resched() behind need_resched()");
torture_param(bool, gp_cond, false, "Use conditional/async GP wait primitives");
torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
-torture_param(bool, gp_normal, false,
- "Use normal (non-expedited) GP wait primitives");
+torture_param(bool, gp_normal, false, "Use normal (non-expedited) GP wait primitives");
torture_param(bool, gp_poll, false, "Use polling GP wait primitives");
torture_param(bool, gp_sync, false, "Use synchronous GP wait primitives");
torture_param(int, irqreader, 1, "Allow RCU readers from irq handlers");
torture_param(int, leakpointer, 0, "Leak pointer dereferences from readers");
-torture_param(int, n_barrier_cbs, 0,
- "# of callbacks/kthreads for barrier testing");
+torture_param(int, n_barrier_cbs, 0, "# of callbacks/kthreads for barrier testing");
torture_param(int, nfakewriters, 4, "Number of RCU fake writer threads");
torture_param(int, nreaders, -1, "Number of RCU reader threads");
-torture_param(int, object_debug, 0,
- "Enable debug-object double call_rcu() testing");
+torture_param(int, object_debug, 0, "Enable debug-object double call_rcu() testing");
torture_param(int, onoff_holdoff, 0, "Time after boot before CPU hotplugs (s)");
-torture_param(int, onoff_interval, 0,
- "Time between CPU hotplugs (jiffies), 0=disable");
+torture_param(int, onoff_interval, 0, "Time between CPU hotplugs (jiffies), 0=disable");
torture_param(int, nocbs_nthreads, 0, "Number of NOCB toggle threads, 0 to disable");
torture_param(int, nocbs_toggle, 1000, "Time between toggling nocb state (ms)");
-torture_param(int, read_exit_delay, 13,
- "Delay between read-then-exit episodes (s)");
-torture_param(int, read_exit_burst, 16,
- "# of read-then-exit bursts per episode, zero to disable");
+torture_param(int, read_exit_delay, 13, "Delay between read-then-exit episodes (s)");
+torture_param(int, read_exit_burst, 16, "# of read-then-exit bursts per episode, zero to disable");
torture_param(int, shuffle_interval, 3, "Number of seconds between shuffles");
torture_param(int, shutdown_secs, 0, "Shutdown time (s), <= zero to disable.");
torture_param(int, stall_cpu, 0, "Stall duration (s), zero to disable.");
-torture_param(int, stall_cpu_holdoff, 10,
- "Time to wait before starting stall (s).");
-torture_param(bool, stall_no_softlockup, false,
- "Avoid softlockup warning during cpu stall.");
+torture_param(int, stall_cpu_holdoff, 10, "Time to wait before starting stall (s).");
+torture_param(bool, stall_no_softlockup, false, "Avoid softlockup warning during cpu stall.");
torture_param(int, stall_cpu_irqsoff, 0, "Disable interrupts while stalling.");
torture_param(int, stall_cpu_block, 0, "Sleep while stalling.");
-torture_param(int, stall_gp_kthread, 0,
- "Grace-period kthread stall duration (s).");
-torture_param(int, stat_interval, 60,
- "Number of seconds between stats printk()s");
+torture_param(int, stall_gp_kthread, 0, "Grace-period kthread stall duration (s).");
+torture_param(int, stat_interval, 60, "Number of seconds between stats printk()s");
torture_param(int, stutter, 5, "Number of seconds to run/halt test");
torture_param(int, test_boost, 1, "Test RCU prio boost: 0=no, 1=maybe, 2=yes.");
-torture_param(int, test_boost_duration, 4,
- "Duration of each boost test, seconds.");
-torture_param(int, test_boost_interval, 7,
- "Interval between boost tests, seconds.");
-torture_param(bool, test_no_idle_hz, true,
- "Test support for tickless idle CPUs");
-torture_param(int, verbose, 1,
- "Enable verbose debugging printk()s");
+torture_param(int, test_boost_duration, 4, "Duration of each boost test, seconds.");
+torture_param(int, test_boost_interval, 7, "Interval between boost tests, seconds.");
+torture_param(bool, test_no_idle_hz, true, "Test support for tickless idle CPUs");
+torture_param(int, verbose, 1, "Enable verbose debugging printk()s");

static char *torture_type = "rcu";
module_param(torture_type, charp, 0444);
--
2.31.1.189.g2e36527f23

2022-06-21 05:21:10

by Neeraj Upadhyay

[permalink] [raw]
Subject: Re: [PATCH rcu 3/3] doc: Document rcutree.nocb_nobypass_lim_per_jiffy kernel parameter



On 6/21/2022 3:47 AM, Paul E. McKenney wrote:
> This commit provides documentation for the kernel parameter controlling
> RCU's handling of callback floods on offloaded (rcu_nocbs) CPUs.
> This parameter might be obscure, but it is always there when you need it.
>
> Reported-by: Frederic Weisbecker <[email protected]>
> Reported-by: Uladzislau Rezki <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>
> ---

Reviewed-by: Neeraj Upadhyay <[email protected]>

> Documentation/admin-guide/kernel-parameters.txt | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index bdf431bdbfdc4..a30890141b1a5 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4681,6 +4681,19 @@
> invoked in the context of an rcuoc kthread, which
> scheduler will preempt as it does any other task.
>
> + rcutree.nocb_nobypass_lim_per_jiffy= [KNL]
> + On callback-offloaded (rcu_nocbs) CPUs,
> + RCU reduces the lock contention that would
> + otherwise be caused callback floods through

Minor : "caused by" ?


Thanks
Neeraj

> + use of the ->nocb_bypass list. However, in the
> + common non-flooded case, RCU queues directly to
> + the main ->cblist in order to avoid the extra
> + overhead of the ->nocb_bypass list and its lock.
> + But if there are too many callbacks queued during
> + a single jiffy, RCU pre-queues the callbacks into
> + the ->nocb_bypass queue. The definition of "too
> + many" is supplied by this kernel boot parameter.
> +
> rcutree.rcu_nocb_gp_stride= [KNL]
> Set the number of NOCB callback kthreads in
> each group, which defaults to the square root

2022-06-21 05:26:47

by Neeraj Upadhyay

[permalink] [raw]
Subject: Re: [PATCH rcu 1/3] rcutorture: Update rcutorture.fwd_progress help text



On 6/21/2022 3:47 AM, Paul E. McKenney wrote:
> This commit updates the rcutorture.fwd_progress help text to say that
> it is the number of forward-progress kthreads to spawn rather than the
> old enable/disable functionality. While in the area, make the list of
> torture-test parameters easier to read by taking advantage of 100 columns.
>
> Signed-off-by: Paul E. McKenney <[email protected]>
> ---

Reviewed-by: Neeraj Upadhyay <[email protected]>

> kernel/rcu/rcutorture.c | 53 ++++++++++++++---------------------------
> 1 file changed, 18 insertions(+), 35 deletions(-)
>
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 7120165a93426..6f47d1490c4f5 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -75,62 +75,45 @@ MODULE_AUTHOR("Paul E. McKenney <[email protected]> and Josh Triplett <josh@
>
> torture_param(int, extendables, RCUTORTURE_MAX_EXTEND,
> "Extend readers by disabling bh (1), irqs (2), or preempt (4)");
> -torture_param(int, fqs_duration, 0,
> - "Duration of fqs bursts (us), 0 to disable");
> +torture_param(int, fqs_duration, 0, "Duration of fqs bursts (us), 0 to disable");
> torture_param(int, fqs_holdoff, 0, "Holdoff time within fqs bursts (us)");
> torture_param(int, fqs_stutter, 3, "Wait time between fqs bursts (s)");
> -torture_param(int, fwd_progress, 1, "Test grace-period forward progress");
> +torture_param(int, fwd_progress, 1, "Number of grace-period forward progress tasks (0 to disable)");
> torture_param(int, fwd_progress_div, 4, "Fraction of CPU stall to wait");
> -torture_param(int, fwd_progress_holdoff, 60,
> - "Time between forward-progress tests (s)");
> -torture_param(bool, fwd_progress_need_resched, 1,
> - "Hide cond_resched() behind need_resched()");
> +torture_param(int, fwd_progress_holdoff, 60, "Time between forward-progress tests (s)");
> +torture_param(bool, fwd_progress_need_resched, 1, "Hide cond_resched() behind need_resched()");
> torture_param(bool, gp_cond, false, "Use conditional/async GP wait primitives");
> torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
> -torture_param(bool, gp_normal, false,
> - "Use normal (non-expedited) GP wait primitives");
> +torture_param(bool, gp_normal, false, "Use normal (non-expedited) GP wait primitives");
> torture_param(bool, gp_poll, false, "Use polling GP wait primitives");
> torture_param(bool, gp_sync, false, "Use synchronous GP wait primitives");
> torture_param(int, irqreader, 1, "Allow RCU readers from irq handlers");
> torture_param(int, leakpointer, 0, "Leak pointer dereferences from readers");
> -torture_param(int, n_barrier_cbs, 0,
> - "# of callbacks/kthreads for barrier testing");
> +torture_param(int, n_barrier_cbs, 0, "# of callbacks/kthreads for barrier testing");
> torture_param(int, nfakewriters, 4, "Number of RCU fake writer threads");
> torture_param(int, nreaders, -1, "Number of RCU reader threads");
> -torture_param(int, object_debug, 0,
> - "Enable debug-object double call_rcu() testing");
> +torture_param(int, object_debug, 0, "Enable debug-object double call_rcu() testing");
> torture_param(int, onoff_holdoff, 0, "Time after boot before CPU hotplugs (s)");
> -torture_param(int, onoff_interval, 0,
> - "Time between CPU hotplugs (jiffies), 0=disable");
> +torture_param(int, onoff_interval, 0, "Time between CPU hotplugs (jiffies), 0=disable");
> torture_param(int, nocbs_nthreads, 0, "Number of NOCB toggle threads, 0 to disable");
> torture_param(int, nocbs_toggle, 1000, "Time between toggling nocb state (ms)");
> -torture_param(int, read_exit_delay, 13,
> - "Delay between read-then-exit episodes (s)");
> -torture_param(int, read_exit_burst, 16,
> - "# of read-then-exit bursts per episode, zero to disable");
> +torture_param(int, read_exit_delay, 13, "Delay between read-then-exit episodes (s)");
> +torture_param(int, read_exit_burst, 16, "# of read-then-exit bursts per episode, zero to disable");
> torture_param(int, shuffle_interval, 3, "Number of seconds between shuffles");
> torture_param(int, shutdown_secs, 0, "Shutdown time (s), <= zero to disable.");
> torture_param(int, stall_cpu, 0, "Stall duration (s), zero to disable.");
> -torture_param(int, stall_cpu_holdoff, 10,
> - "Time to wait before starting stall (s).");
> -torture_param(bool, stall_no_softlockup, false,
> - "Avoid softlockup warning during cpu stall.");
> +torture_param(int, stall_cpu_holdoff, 10, "Time to wait before starting stall (s).");
> +torture_param(bool, stall_no_softlockup, false, "Avoid softlockup warning during cpu stall.");
> torture_param(int, stall_cpu_irqsoff, 0, "Disable interrupts while stalling.");
> torture_param(int, stall_cpu_block, 0, "Sleep while stalling.");
> -torture_param(int, stall_gp_kthread, 0,
> - "Grace-period kthread stall duration (s).");
> -torture_param(int, stat_interval, 60,
> - "Number of seconds between stats printk()s");
> +torture_param(int, stall_gp_kthread, 0, "Grace-period kthread stall duration (s).");
> +torture_param(int, stat_interval, 60, "Number of seconds between stats printk()s");
> torture_param(int, stutter, 5, "Number of seconds to run/halt test");
> torture_param(int, test_boost, 1, "Test RCU prio boost: 0=no, 1=maybe, 2=yes.");
> -torture_param(int, test_boost_duration, 4,
> - "Duration of each boost test, seconds.");
> -torture_param(int, test_boost_interval, 7,
> - "Interval between boost tests, seconds.");
> -torture_param(bool, test_no_idle_hz, true,
> - "Test support for tickless idle CPUs");
> -torture_param(int, verbose, 1,
> - "Enable verbose debugging printk()s");
> +torture_param(int, test_boost_duration, 4, "Duration of each boost test, seconds.");
> +torture_param(int, test_boost_interval, 7, "Interval between boost tests, seconds.");
> +torture_param(bool, test_no_idle_hz, true, "Test support for tickless idle CPUs");
> +torture_param(int, verbose, 1, "Enable verbose debugging printk()s");
>
> static char *torture_type = "rcu";
> module_param(torture_type, charp, 0444);

2022-06-21 05:31:08

by Neeraj Upadhyay

[permalink] [raw]
Subject: Re: [PATCH rcu 2/3] doc: Document the rcutree.rcu_divisor kernel boot parameter



On 6/21/2022 3:47 AM, Paul E. McKenney wrote:
> This commit adds kernel-parameters.txt documentation for the
> rcutree.rcu_divisor kernel boot parameter, which controls the softirq
> callback-invocation batch limit.
>
> Cc: Eric Dumazet <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>
> ---

Reviewed-by: Neeraj Upadhyay <[email protected]>

> Documentation/admin-guide/kernel-parameters.txt | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 2522b11e593f2..bdf431bdbfdc4 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4666,6 +4666,21 @@
> When RCU_NOCB_CPU is set, also adjust the
> priority of NOCB callback kthreads.
>
> + rcutree.rcu_divisor= [KNL]
> + Set the shift-right count to use to compute
> + the callback-invocation batch limit bl from
> + the number of callbacks queued on this CPU.
> + The result will be bounded below by the value of
> + the rcutree.blimit kernel parameter. Every bl
> + callbacks, the softirq handler will exit in
> + order to allow the CPU to do other work.
> +
> + Please note that this callback-invocation batch
> + limit applies only to non-offloaded callback
> + invocation. Offloaded callbacks are instead
> + invoked in the context of an rcuoc kthread, which
> + scheduler will preempt as it does any other task.
> +
> rcutree.rcu_nocb_gp_stride= [KNL]
> Set the number of NOCB callback kthreads in
> each group, which defaults to the square root

2022-06-21 19:13:08

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH rcu 3/3] doc: Document rcutree.nocb_nobypass_lim_per_jiffy kernel parameter

On Tue, Jun 21, 2022 at 10:41:54AM +0530, Neeraj Upadhyay wrote:
>
>
> On 6/21/2022 3:47 AM, Paul E. McKenney wrote:
> > This commit provides documentation for the kernel parameter controlling
> > RCU's handling of callback floods on offloaded (rcu_nocbs) CPUs.
> > This parameter might be obscure, but it is always there when you need it.
> >
> > Reported-by: Frederic Weisbecker <[email protected]>
> > Reported-by: Uladzislau Rezki <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
> > ---
>
> Reviewed-by: Neeraj Upadhyay <[email protected]>
>
> > Documentation/admin-guide/kernel-parameters.txt | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index bdf431bdbfdc4..a30890141b1a5 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -4681,6 +4681,19 @@
> > invoked in the context of an rcuoc kthread, which
> > scheduler will preempt as it does any other task.
> > + rcutree.nocb_nobypass_lim_per_jiffy= [KNL]
> > + On callback-offloaded (rcu_nocbs) CPUs,
> > + RCU reduces the lock contention that would
> > + otherwise be caused callback floods through
>
> Minor : "caused by" ?

Good catch, fixed, thank you!

I applied your Reviewed-by to this series as well, and thank you for
that as well.

Thanx, Paul

> Thanks
> Neeraj
>
> > + use of the ->nocb_bypass list. However, in the
> > + common non-flooded case, RCU queues directly to
> > + the main ->cblist in order to avoid the extra
> > + overhead of the ->nocb_bypass list and its lock.
> > + But if there are too many callbacks queued during
> > + a single jiffy, RCU pre-queues the callbacks into
> > + the ->nocb_bypass queue. The definition of "too
> > + many" is supplied by this kernel boot parameter.
> > +
> > rcutree.rcu_nocb_gp_stride= [KNL]
> > Set the number of NOCB callback kthreads in
> > each group, which defaults to the square root