aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-01-31 00:32:09 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 16:39:47 -0400
commit620316e52a923811fe9a77ceb43eebf5f507d375 (patch)
treec5f6cea89e511b348ed11bb18e707dfa260cbe8e /kernel/rcu
parentdf37e66bfdbb57e8cae7dbf39a0c66b1b8701338 (diff)
rcutorture: Avoid RCU CPU stall warning and RT throttling
Running rcuperf can result in RCU CPU stall warnings and RT throttling. These occur because on of the real-time writer processes does ftrace_dump() while still running at real-time priority. This commit therefore prevents these problems by setting the writer thread back to SCHED_NORMAL (AKA SCHED_OTHER) before doing ftrace_dump(). In addition, this commit adds a small fixed delay before dumping ftrace buffer in order to decrease the probability that this dumping will interfere with other writers' grace periods. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/rcuperf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 278600143bb6..4c0572859ff0 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -404,11 +404,15 @@ rcu_perf_writer(void *arg)
404 started = true; 404 started = true;
405 if (!done && i >= MIN_MEAS) { 405 if (!done && i >= MIN_MEAS) {
406 done = true; 406 done = true;
407 sp.sched_priority = 0;
408 sched_setscheduler_nocheck(current,
409 SCHED_NORMAL, &sp);
407 pr_alert("%s" PERF_FLAG 410 pr_alert("%s" PERF_FLAG
408 "rcu_perf_writer %ld has %d measurements\n", 411 "rcu_perf_writer %ld has %d measurements\n",
409 perf_type, me, MIN_MEAS); 412 perf_type, me, MIN_MEAS);
410 if (atomic_inc_return(&n_rcu_perf_writer_finished) >= 413 if (atomic_inc_return(&n_rcu_perf_writer_finished) >=
411 nrealwriters) { 414 nrealwriters) {
415 schedule_timeout_interruptible(10);
412 rcu_ftrace_dump(DUMP_ALL); 416 rcu_ftrace_dump(DUMP_ALL);
413 PERFOUT_STRING("Test complete"); 417 PERFOUT_STRING("Test complete");
414 t_rcu_perf_writer_finished = t; 418 t_rcu_perf_writer_finished = t;