public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rcu: Assign higher priority to RCU threads if its rcutorture
@ 2018-06-19  6:22 Joel Fernandes
  2018-06-19  6:22 ` [PATCH 2/2] rcutorture: Fix rcu_barrier successes counter Joel Fernandes
  2018-06-19  6:34 ` [PATCH 1/2] rcu: Assign higher priority to RCU threads if its rcutorture Joel Fernandes
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Fernandes @ 2018-06-19  6:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, Joel Fernandes (Google), Josh Triplett,
	Lai Jiangshan, Mathieu Desnoyers, Paul E. McKenney,
	Steven Rostedt, Byungchul Park

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

rcutorture boost tests fail even with CONFIG_RCU_BOOST set because
rcutorture's threads are equal priority to the default RCU kthreads (RT
class with priority of 1).

This patch checks if RCU torture is built into the kernel and if so,
assigns a higher priority to the RCU threads. With this the rcutorture
boost tests pass.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 kernel/rcu/tree.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index deb2508be923..a141d6314622 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -171,7 +171,7 @@ static void rcu_report_exp_rdp(struct rcu_state *rsp,
 static void sync_sched_exp_online_cleanup(int cpu);
 
 /* rcuc/rcub kthread realtime priority */
-static int kthread_prio = IS_ENABLED(CONFIG_RCU_BOOST) ? 1 : 0;
+static int kthread_prio;
 module_param(kthread_prio, int, 0644);
 
 /* Delay in jiffies for grace-period initialization delays, debug only. */
@@ -3884,12 +3884,16 @@ static int __init rcu_spawn_gp_kthread(void)
 	struct task_struct *t;
 
 	/* Force priority into range. */
-	if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 1)
+	if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 2
+	    && IS_BUILTIN(CONFIG_RCU_TORTURE_TEST))
+		kthread_prio = 2;
+	else if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 1)
 		kthread_prio = 1;
 	else if (kthread_prio < 0)
 		kthread_prio = 0;
 	else if (kthread_prio > 99)
 		kthread_prio = 99;
+
 	if (kthread_prio != kthread_prio_in)
 		pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n",
 			 kthread_prio, kthread_prio_in);
-- 
2.18.0.rc1.244.gcf134e6275-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-19 22:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19  6:22 [PATCH 1/2] rcu: Assign higher priority to RCU threads if its rcutorture Joel Fernandes
2018-06-19  6:22 ` [PATCH 2/2] rcutorture: Fix rcu_barrier successes counter Joel Fernandes
2018-06-19  7:31   ` Joel Fernandes
2018-06-19 13:12     ` Steven Rostedt
2018-06-19 15:41       ` Paul E. McKenney
2018-06-19 22:16         ` Joel Fernandes
2018-06-19  6:34 ` [PATCH 1/2] rcu: Assign higher priority to RCU threads if its rcutorture Joel Fernandes
2018-06-19 16:00   ` Paul E. McKenney
2018-06-19 22:19     ` Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox