瀏覽代碼

rcu: Assign higher prio to RCU threads if rcutorture is built-in

The rcutorture RCU priority boosting tests fail even with CONFIG_RCU_BOOST
set because rcutorture's threads run at the same priority as 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 RT priority 1 to the RCU threads, allowing the rcutorture boost
tests to pass.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Joel Fernandes (Google) 7 年之前
父節點
當前提交
c7cd161ecb
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      kernel/rcu/tree.c

+ 5 - 1
kernel/rcu/tree.c

@@ -3923,12 +3923,16 @@ static int __init rcu_spawn_gp_kthread(void)
 	struct task_struct *t;
 	struct task_struct *t;
 
 
 	/* Force priority into range. */
 	/* 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;
 		kthread_prio = 1;
 	else if (kthread_prio < 0)
 	else if (kthread_prio < 0)
 		kthread_prio = 0;
 		kthread_prio = 0;
 	else if (kthread_prio > 99)
 	else if (kthread_prio > 99)
 		kthread_prio = 99;
 		kthread_prio = 99;
+
 	if (kthread_prio != kthread_prio_in)
 	if (kthread_prio != kthread_prio_in)
 		pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n",
 		pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n",
 			 kthread_prio, kthread_prio_in);
 			 kthread_prio, kthread_prio_in);