This commit adds a hazptrtorture.nwriters module parameter that, when set to zero, disables hazard-pointer update-side activity.
[ paulmck: Apply Breno Leitao feedback. ] Signed-off-by: Paul E. McKenney <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: <[email protected]> Cc: <[email protected]> --- kernel/rcu/hazptrtorture.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/rcu/hazptrtorture.c b/kernel/rcu/hazptrtorture.c index ece38f444be6..045ab6fc7ba2 100644 --- a/kernel/rcu/hazptrtorture.c +++ b/kernel/rcu/hazptrtorture.c @@ -36,6 +36,7 @@ torture_param(int, irq_acquire, -1, torture_param(int, kthread_do_pending_ms, -1, "Delay between cleanups for deferred hazard pointers (ms), zero to disable"); torture_param(int, nreaders, -1, "Number of hazard-pointer reader threads"); +torture_param(bool, nwriters, 1, "Number of hazard-pointer writer threads, 0 or 1"); 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, preempt_duration, 0, "Preemption duration (ms), zero to disable"); @@ -657,14 +658,14 @@ static void hazptr_torture_print_module_parms(struct hazptr_torture_ops *cur_ops, const char *tag) { pr_alert("%s" TORTURE_FLAG - "--- %s: nreaders=%d " + "--- %s: nreaders=%d nwriters=%d " "defer_modulus=%d irq_acquire=%d kthread_do_pending_ms=%d " "onoff_interval=%d onoff_holdoff=%d " "preempt_duration=%d preempt_interval=%d " "reader_sleep_us=%d " "shuffle_interval=%d shutdown_secs=%d stat_interval=%d stutter=%d " "verbose=%d\n", - torture_type, tag, nrealreaders, + torture_type, tag, nrealreaders, nwriters, defer_modulus, irq_acquire, kthread_do_pending_ms, onoff_interval, onoff_holdoff, preempt_duration, preempt_interval, @@ -824,9 +825,11 @@ static int __init hazptr_torture_init(void) goto unwind; } - firsterr = torture_create_kthread(hazptr_torture_writer, NULL, writer_task); - if (torture_init_error(firsterr)) - goto unwind; + if (nwriters) { + firsterr = torture_create_kthread(hazptr_torture_writer, NULL, writer_task); + if (torture_init_error(firsterr)) + goto unwind; + } firsterr = torture_onoff_init(onoff_holdoff * HZ, onoff_interval, NULL); if (torture_init_error(firsterr)) -- 2.40.1

