Skip to content

Commit 7221f49

Browse files
committed
rcuscale: Add minruntime module parameter
By default, rcuscale collects only 100 points of data per writer, but arranging for all kthreads to be actively collecting (if not recording) data during the time that any kthread might be recording. This works well, but does not allow much time to bring external performance tools to bear. This commit therefore adds a minruntime module parameter that specifies a minimum data-collection interval in seconds. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent ee7516a commit 7221f49

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4953,6 +4953,12 @@
49534953
Number of loops doing rcuscale.kfree_alloc_num number
49544954
of allocations and frees.
49554955

4956+
rcuscale.minruntime= [KNL]
4957+
Set the minimum test run time in seconds. This
4958+
does not affect the data-collection interval,
4959+
but instead allows better measurement of things
4960+
like CPU consumption.
4961+
49564962
rcuscale.nreaders= [KNL]
49574963
Set number of RCU readers. The value -1 selects
49584964
N, where N is the number of CPUs. A value

kernel/rcu/rcuscale.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives");
8787
torture_param(int, gp_async_max, 1000, "Max # outstanding waits per writer");
8888
torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
8989
torture_param(int, holdoff, 10, "Holdoff time before test start (s)");
90+
torture_param(int, minruntime, 0, "Minimum run time (s)");
9091
torture_param(int, nreaders, -1, "Number of RCU reader threads");
9192
torture_param(int, nwriters, -1, "Number of RCU updater threads");
9293
torture_param(bool, shutdown, RCUSCALE_SHUTDOWN,
@@ -411,6 +412,7 @@ rcu_scale_writer(void *arg)
411412
{
412413
int i = 0;
413414
int i_max;
415+
unsigned long jdone;
414416
long me = (long)arg;
415417
struct rcu_head *rhp = NULL;
416418
bool started = false, done = false, alldone = false;
@@ -447,6 +449,7 @@ rcu_scale_writer(void *arg)
447449
}
448450
}
449451

452+
jdone = jiffies + minruntime * HZ;
450453
do {
451454
if (writer_holdoff)
452455
udelay(writer_holdoff);
@@ -479,7 +482,7 @@ rcu_scale_writer(void *arg)
479482
if (!started &&
480483
atomic_read(&n_rcu_scale_writer_started) >= nrealwriters)
481484
started = true;
482-
if (!done && i >= MIN_MEAS) {
485+
if (!done && i >= MIN_MEAS && time_after(jiffies, jdone)) {
483486
done = true;
484487
sched_set_normal(current, 0);
485488
pr_alert("%s%s rcu_scale_writer %ld has %d measurements\n",

0 commit comments

Comments
 (0)