aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutorture.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r--kernel/rcutorture.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 53c548c39265..2736cc878ba2 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -177,8 +177,14 @@ static long n_rcu_torture_boosts;
177static long n_rcu_torture_timers; 177static long n_rcu_torture_timers;
178static long n_offline_attempts; 178static long n_offline_attempts;
179static long n_offline_successes; 179static long n_offline_successes;
180static unsigned long sum_offline;
181static int min_offline = -1;
182static int max_offline;
180static long n_online_attempts; 183static long n_online_attempts;
181static long n_online_successes; 184static long n_online_successes;
185static unsigned long sum_online;
186static int min_online = -1;
187static int max_online;
182static long n_barrier_attempts; 188static long n_barrier_attempts;
183static long n_barrier_successes; 189static long n_barrier_successes;
184static struct list_head rcu_torture_removed; 190static struct list_head rcu_torture_removed;
@@ -1215,11 +1221,13 @@ rcu_torture_printk(char *page)
1215 n_rcu_torture_boost_failure, 1221 n_rcu_torture_boost_failure,
1216 n_rcu_torture_boosts, 1222 n_rcu_torture_boosts,
1217 n_rcu_torture_timers); 1223 n_rcu_torture_timers);
1218 cnt += sprintf(&page[cnt], "onoff: %ld/%ld:%ld/%ld ", 1224 cnt += sprintf(&page[cnt],
1219 n_online_successes, 1225 "onoff: %ld/%ld:%ld/%ld %d,%d:%d,%d %lu:%lu (HZ=%d) ",
1220 n_online_attempts, 1226 n_online_successes, n_online_attempts,
1221 n_offline_successes, 1227 n_offline_successes, n_offline_attempts,
1222 n_offline_attempts); 1228 min_online, max_online,
1229 min_offline, max_offline,
1230 sum_online, sum_offline, HZ);
1223 cnt += sprintf(&page[cnt], "barrier: %ld/%ld:%ld", 1231 cnt += sprintf(&page[cnt], "barrier: %ld/%ld:%ld",
1224 n_barrier_successes, 1232 n_barrier_successes,
1225 n_barrier_attempts, 1233 n_barrier_attempts,
@@ -1491,8 +1499,10 @@ static int __cpuinit
1491rcu_torture_onoff(void *arg) 1499rcu_torture_onoff(void *arg)
1492{ 1500{
1493 int cpu; 1501 int cpu;
1502 unsigned long delta;
1494 int maxcpu = -1; 1503 int maxcpu = -1;
1495 DEFINE_RCU_RANDOM(rand); 1504 DEFINE_RCU_RANDOM(rand);
1505 unsigned long starttime;
1496 1506
1497 VERBOSE_PRINTK_STRING("rcu_torture_onoff task started"); 1507 VERBOSE_PRINTK_STRING("rcu_torture_onoff task started");
1498 for_each_online_cpu(cpu) 1508 for_each_online_cpu(cpu)
@@ -1510,6 +1520,7 @@ rcu_torture_onoff(void *arg)
1510 printk(KERN_ALERT "%s" TORTURE_FLAG 1520 printk(KERN_ALERT "%s" TORTURE_FLAG
1511 "rcu_torture_onoff task: offlining %d\n", 1521 "rcu_torture_onoff task: offlining %d\n",
1512 torture_type, cpu); 1522 torture_type, cpu);
1523 starttime = jiffies;
1513 n_offline_attempts++; 1524 n_offline_attempts++;
1514 if (cpu_down(cpu) == 0) { 1525 if (cpu_down(cpu) == 0) {
1515 if (verbose) 1526 if (verbose)
@@ -1517,12 +1528,23 @@ rcu_torture_onoff(void *arg)
1517 "rcu_torture_onoff task: offlined %d\n", 1528 "rcu_torture_onoff task: offlined %d\n",
1518 torture_type, cpu); 1529 torture_type, cpu);
1519 n_offline_successes++; 1530 n_offline_successes++;
1531 delta = jiffies - starttime;
1532 sum_offline += delta;
1533 if (min_offline < 0) {
1534 min_offline = delta;
1535 max_offline = delta;
1536 }
1537 if (min_offline > delta)
1538 min_offline = delta;
1539 if (max_offline < delta)
1540 max_offline = delta;
1520 } 1541 }
1521 } else if (cpu_is_hotpluggable(cpu)) { 1542 } else if (cpu_is_hotpluggable(cpu)) {
1522 if (verbose) 1543 if (verbose)
1523 printk(KERN_ALERT "%s" TORTURE_FLAG 1544 printk(KERN_ALERT "%s" TORTURE_FLAG
1524 "rcu_torture_onoff task: onlining %d\n", 1545 "rcu_torture_onoff task: onlining %d\n",
1525 torture_type, cpu); 1546 torture_type, cpu);
1547 starttime = jiffies;
1526 n_online_attempts++; 1548 n_online_attempts++;
1527 if (cpu_up(cpu) == 0) { 1549 if (cpu_up(cpu) == 0) {
1528 if (verbose) 1550 if (verbose)
@@ -1530,6 +1552,16 @@ rcu_torture_onoff(void *arg)
1530 "rcu_torture_onoff task: onlined %d\n", 1552 "rcu_torture_onoff task: onlined %d\n",
1531 torture_type, cpu); 1553 torture_type, cpu);
1532 n_online_successes++; 1554 n_online_successes++;
1555 delta = jiffies - starttime;
1556 sum_online += delta;
1557 if (min_online < 0) {
1558 min_online = delta;
1559 max_online = delta;
1560 }
1561 if (min_online > delta)
1562 min_online = delta;
1563 if (max_online < delta)
1564 max_online = delta;
1533 } 1565 }
1534 } 1566 }
1535 schedule_timeout_interruptible(onoff_interval * HZ); 1567 schedule_timeout_interruptible(onoff_interval * HZ);