Skip to content

Commit ff9ba8d

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
rcuscale: Add guest_os_delay module parameter
This commit adds a guest_os_delay module parameter that extends warm-up and cool-down the specified number of seconds before and after the series of test runs. This allows the data-collection intervals from any given rcuscale guest OSes to line up with active periods in the other rcuscale guest OSes, and also allows the thermal warm-up period required to obtain consistent results from one test to the next. Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Neeraj Upadhyay <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 046c06f commit ff9ba8d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

kernel/rcu/refscale.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ MODULE_PARM_DESC(scale_type, "Type of test (rcu, srcu, refcnt, rwsem, rwlock.");
7575
torture_param(int, verbose, 0, "Enable verbose debugging printk()s");
7676
torture_param(int, verbose_batched, 0, "Batch verbose debugging printk()s");
7777

78+
// Number of seconds to extend warm-up and cool-down for multiple guest OSes
79+
torture_param(long, guest_os_delay, 0,
80+
"Number of seconds to extend warm-up/cool-down for multiple guest OSes.");
7881
// Wait until there are multiple CPUs before starting test.
7982
torture_param(int, holdoff, IS_BUILTIN(CONFIG_RCU_REF_SCALE_TEST) ? 10 : 0,
8083
"Holdoff time before test start (s)");
@@ -801,6 +804,18 @@ static void rcu_scale_one_reader(void)
801804
cur_ops->delaysection(loops, readdelay / 1000, readdelay % 1000);
802805
}
803806

807+
// Warm up cache, or, if needed run a series of rcu_scale_one_reader()
808+
// to allow multiple rcuscale guest OSes to collect mutually valid data.
809+
static void rcu_scale_warm_cool(void)
810+
{
811+
unsigned long jdone = jiffies + (guest_os_delay > 0 ? guest_os_delay * HZ : -1);
812+
813+
do {
814+
rcu_scale_one_reader();
815+
cond_resched();
816+
} while (time_before(jiffies, jdone));
817+
}
818+
804819
// Reader kthread. Repeatedly does empty RCU read-side
805820
// critical section, minimizing update-side interference.
806821
static int
@@ -957,6 +972,7 @@ static int main_func(void *arg)
957972
schedule_timeout_uninterruptible(1);
958973

959974
// Start exp readers up per experiment
975+
rcu_scale_warm_cool();
960976
for (exp = 0; exp < nruns && !torture_must_stop(); exp++) {
961977
if (torture_must_stop())
962978
goto end;
@@ -987,6 +1003,7 @@ static int main_func(void *arg)
9871003

9881004
result_avg[exp] = div_u64(1000 * process_durations(nreaders), nreaders * loops);
9891005
}
1006+
rcu_scale_warm_cool();
9901007

9911008
// Print the average of all experiments
9921009
SCALEOUT("END OF TEST. Calculating average duration per loop (nanoseconds)...\n");

0 commit comments

Comments
 (0)