diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-01-17 17:36:51 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-02-21 12:03:50 -0500 |
commit | 9b9ec9b90ef481e182927989963274dc2697f9a6 (patch) | |
tree | 977b0fc115b279c25de3200a6bd4d67f1eff83c8 /kernel/rcutorture.c | |
parent | a858af2875fb291d0f4b0a4419fefbf03c2379c0 (diff) |
rcutorture: Permit holding off CPU-hotplug operations during boot
When rcutorture is started automatically at boot time, it might well
also start CPU-hotplug operations at that time, which might not be
desirable. This commit therefore adds an rcutorture parameter that
allows CPU-hotplug operations to be held off for the specified number
of seconds after the start of boot.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r-- | kernel/rcutorture.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index a52b3217c160..2914cafe171b 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -65,6 +65,7 @@ static int fqs_duration; /* Duration of bursts (us), 0 to disable. */ | |||
65 | static int fqs_holdoff; /* Hold time within burst (us). */ | 65 | static int fqs_holdoff; /* Hold time within burst (us). */ |
66 | static int fqs_stutter = 3; /* Wait time between bursts (s). */ | 66 | static int fqs_stutter = 3; /* Wait time between bursts (s). */ |
67 | static int onoff_interval; /* Wait time between CPU hotplugs, 0=disable. */ | 67 | static int onoff_interval; /* Wait time between CPU hotplugs, 0=disable. */ |
68 | static int onoff_holdoff; /* Seconds after boot before CPU hotplugs. */ | ||
68 | static int shutdown_secs; /* Shutdown time (s). <=0 for no shutdown. */ | 69 | static int shutdown_secs; /* Shutdown time (s). <=0 for no shutdown. */ |
69 | static int test_boost = 1; /* Test RCU prio boost: 0=no, 1=maybe, 2=yes. */ | 70 | static int test_boost = 1; /* Test RCU prio boost: 0=no, 1=maybe, 2=yes. */ |
70 | static int test_boost_interval = 7; /* Interval between boost tests, seconds. */ | 71 | static int test_boost_interval = 7; /* Interval between boost tests, seconds. */ |
@@ -95,6 +96,8 @@ module_param(fqs_stutter, int, 0444); | |||
95 | MODULE_PARM_DESC(fqs_stutter, "Wait time between fqs bursts (s)"); | 96 | MODULE_PARM_DESC(fqs_stutter, "Wait time between fqs bursts (s)"); |
96 | module_param(onoff_interval, int, 0444); | 97 | module_param(onoff_interval, int, 0444); |
97 | MODULE_PARM_DESC(onoff_interval, "Time between CPU hotplugs (s), 0=disable"); | 98 | MODULE_PARM_DESC(onoff_interval, "Time between CPU hotplugs (s), 0=disable"); |
99 | module_param(onoff_holdoff, int, 0444); | ||
100 | MODULE_PARM_DESC(onoff_holdoff, "Time after boot before CPU hotplugs (s)"); | ||
98 | module_param(shutdown_secs, int, 0444); | 101 | module_param(shutdown_secs, int, 0444); |
99 | MODULE_PARM_DESC(shutdown_secs, "Shutdown time (s), zero to disable."); | 102 | MODULE_PARM_DESC(shutdown_secs, "Shutdown time (s), zero to disable."); |
100 | module_param(test_boost, int, 0444); | 103 | module_param(test_boost, int, 0444); |
@@ -1300,13 +1303,13 @@ rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, char *tag) | |||
1300 | "fqs_duration=%d fqs_holdoff=%d fqs_stutter=%d " | 1303 | "fqs_duration=%d fqs_holdoff=%d fqs_stutter=%d " |
1301 | "test_boost=%d/%d test_boost_interval=%d " | 1304 | "test_boost=%d/%d test_boost_interval=%d " |
1302 | "test_boost_duration=%d shutdown_secs=%d " | 1305 | "test_boost_duration=%d shutdown_secs=%d " |
1303 | "onoff_interval=%d\n", | 1306 | "onoff_interval=%d onoff_holdoff=%d\n", |
1304 | torture_type, tag, nrealreaders, nfakewriters, | 1307 | torture_type, tag, nrealreaders, nfakewriters, |
1305 | stat_interval, verbose, test_no_idle_hz, shuffle_interval, | 1308 | stat_interval, verbose, test_no_idle_hz, shuffle_interval, |
1306 | stutter, irqreader, fqs_duration, fqs_holdoff, fqs_stutter, | 1309 | stutter, irqreader, fqs_duration, fqs_holdoff, fqs_stutter, |
1307 | test_boost, cur_ops->can_boost, | 1310 | test_boost, cur_ops->can_boost, |
1308 | test_boost_interval, test_boost_duration, shutdown_secs, | 1311 | test_boost_interval, test_boost_duration, shutdown_secs, |
1309 | onoff_interval); | 1312 | onoff_interval, onoff_holdoff); |
1310 | } | 1313 | } |
1311 | 1314 | ||
1312 | static struct notifier_block rcutorture_shutdown_nb = { | 1315 | static struct notifier_block rcutorture_shutdown_nb = { |
@@ -1410,6 +1413,11 @@ rcu_torture_onoff(void *arg) | |||
1410 | for_each_online_cpu(cpu) | 1413 | for_each_online_cpu(cpu) |
1411 | maxcpu = cpu; | 1414 | maxcpu = cpu; |
1412 | WARN_ON(maxcpu < 0); | 1415 | WARN_ON(maxcpu < 0); |
1416 | if (onoff_holdoff > 0) { | ||
1417 | VERBOSE_PRINTK_STRING("rcu_torture_onoff begin holdoff"); | ||
1418 | schedule_timeout_interruptible(onoff_holdoff * HZ); | ||
1419 | VERBOSE_PRINTK_STRING("rcu_torture_onoff end holdoff"); | ||
1420 | } | ||
1413 | while (!kthread_should_stop()) { | 1421 | while (!kthread_should_stop()) { |
1414 | cpu = (rcu_random(&rand) >> 4) % (maxcpu + 1); | 1422 | cpu = (rcu_random(&rand) >> 4) % (maxcpu + 1); |
1415 | if (cpu_online(cpu) && cpu_is_hotpluggable(cpu)) { | 1423 | if (cpu_online(cpu) && cpu_is_hotpluggable(cpu)) { |