Commit 7221f493 authored by Paul E. McKenney's avatar Paul E. McKenney

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: default avatarPaul E. McKenney <paulmck@kernel.org>
parent ee7516a1
...@@ -4953,6 +4953,12 @@ ...@@ -4953,6 +4953,12 @@
Number of loops doing rcuscale.kfree_alloc_num number Number of loops doing rcuscale.kfree_alloc_num number
of allocations and frees. of allocations and frees.
rcuscale.minruntime= [KNL]
Set the minimum test run time in seconds. This
does not affect the data-collection interval,
but instead allows better measurement of things
like CPU consumption.
rcuscale.nreaders= [KNL] rcuscale.nreaders= [KNL]
Set number of RCU readers. The value -1 selects Set number of RCU readers. The value -1 selects
N, where N is the number of CPUs. A value N, where N is the number of CPUs. A value
......
...@@ -87,6 +87,7 @@ torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives"); ...@@ -87,6 +87,7 @@ torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives");
torture_param(int, gp_async_max, 1000, "Max # outstanding waits per writer"); torture_param(int, gp_async_max, 1000, "Max # outstanding waits per writer");
torture_param(bool, gp_exp, false, "Use expedited GP wait primitives"); torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
torture_param(int, holdoff, 10, "Holdoff time before test start (s)"); torture_param(int, holdoff, 10, "Holdoff time before test start (s)");
torture_param(int, minruntime, 0, "Minimum run time (s)");
torture_param(int, nreaders, -1, "Number of RCU reader threads"); torture_param(int, nreaders, -1, "Number of RCU reader threads");
torture_param(int, nwriters, -1, "Number of RCU updater threads"); torture_param(int, nwriters, -1, "Number of RCU updater threads");
torture_param(bool, shutdown, RCUSCALE_SHUTDOWN, torture_param(bool, shutdown, RCUSCALE_SHUTDOWN,
...@@ -411,6 +412,7 @@ rcu_scale_writer(void *arg) ...@@ -411,6 +412,7 @@ rcu_scale_writer(void *arg)
{ {
int i = 0; int i = 0;
int i_max; int i_max;
unsigned long jdone;
long me = (long)arg; long me = (long)arg;
struct rcu_head *rhp = NULL; struct rcu_head *rhp = NULL;
bool started = false, done = false, alldone = false; bool started = false, done = false, alldone = false;
...@@ -447,6 +449,7 @@ rcu_scale_writer(void *arg) ...@@ -447,6 +449,7 @@ rcu_scale_writer(void *arg)
} }
} }
jdone = jiffies + minruntime * HZ;
do { do {
if (writer_holdoff) if (writer_holdoff)
udelay(writer_holdoff); udelay(writer_holdoff);
...@@ -479,7 +482,7 @@ rcu_scale_writer(void *arg) ...@@ -479,7 +482,7 @@ rcu_scale_writer(void *arg)
if (!started && if (!started &&
atomic_read(&n_rcu_scale_writer_started) >= nrealwriters) atomic_read(&n_rcu_scale_writer_started) >= nrealwriters)
started = true; started = true;
if (!done && i >= MIN_MEAS) { if (!done && i >= MIN_MEAS && time_after(jiffies, jdone)) {
done = true; done = true;
sched_set_normal(current, 0); sched_set_normal(current, 0);
pr_alert("%s%s rcu_scale_writer %ld has %d measurements\n", pr_alert("%s%s rcu_scale_writer %ld has %d measurements\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment