Skip to content

Commit 2226f3d

Browse files
committed
rcuscale: Permit blocking delays between writers
Some workloads do isolated RCU work, and this can affect operation latencies. This commit therefore adds a writer_holdoff_jiffies module parameter that causes writers to block for the specified number of jiffies between each pair of consecutive write-side operations. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 06c2afb commit 2226f3d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,6 +4983,11 @@
49834983
in microseconds. The default of zero says
49844984
no holdoff.
49854985

4986+
rcuscale.writer_holdoff_jiffies= [KNL]
4987+
Additional write-side holdoff between grace
4988+
periods, but in jiffies. The default of zero
4989+
says no holdoff.
4990+
49864991
rcutorture.fqs_duration= [KNL]
49874992
Set duration of force_quiescent_state bursts
49884993
in microseconds.

kernel/rcu/rcuscale.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ torture_param(bool, shutdown, RCUSCALE_SHUTDOWN,
9393
"Shutdown at end of scalability tests.");
9494
torture_param(int, verbose, 1, "Enable verbose debugging printk()s");
9595
torture_param(int, writer_holdoff, 0, "Holdoff (us) between GPs, zero to disable");
96+
torture_param(int, writer_holdoff_jiffies, 0, "Holdoff (jiffies) between GPs, zero to disable");
9697
torture_param(int, kfree_rcu_test, 0, "Do we run a kfree_rcu() scale test?");
9798
torture_param(int, kfree_mult, 1, "Multiple of kfree_obj size to allocate.");
9899
torture_param(int, kfree_by_call_rcu, 0, "Use call_rcu() to emulate kfree_rcu()?");
@@ -414,6 +415,7 @@ rcu_scale_writer(void *arg)
414415
struct rcu_head *rhp = NULL;
415416
bool started = false, done = false, alldone = false;
416417
u64 t;
418+
DEFINE_TORTURE_RANDOM(tr);
417419
u64 *wdp;
418420
u64 *wdpp = writer_durations[me];
419421

@@ -448,6 +450,8 @@ rcu_scale_writer(void *arg)
448450
do {
449451
if (writer_holdoff)
450452
udelay(writer_holdoff);
453+
if (writer_holdoff_jiffies)
454+
schedule_timeout_idle(torture_random(&tr) % writer_holdoff_jiffies + 1);
451455
wdp = &wdpp[i];
452456
*wdp = ktime_get_mono_fast_ns();
453457
if (gp_async) {

0 commit comments

Comments
 (0)