aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2018-06-19 18:14:17 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-07-12 18:39:26 -0400
commitc7cd161ecb2188c07ba9560ca82aee756575359f (patch)
tree8b639591aee1041bef4fef0e950dfbcd48eb9eba /kernel/rcu/tree.c
parentb7b6f94cf6e6d961f78064315b6f5de5d9c6414b (diff)
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>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 7498a416f63b..8143b8d40a6c 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3923,12 +3923,16 @@ static int __init rcu_spawn_gp_kthread(void)
3923 struct task_struct *t; 3923 struct task_struct *t;
3924 3924
3925 /* Force priority into range. */ 3925 /* Force priority into range. */
3926 if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 1) 3926 if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 2
3927 && IS_BUILTIN(CONFIG_RCU_TORTURE_TEST))
3928 kthread_prio = 2;
3929 else if (IS_ENABLED(CONFIG_RCU_BOOST) && kthread_prio < 1)
3927 kthread_prio = 1; 3930 kthread_prio = 1;
3928 else if (kthread_prio < 0) 3931 else if (kthread_prio < 0)
3929 kthread_prio = 0; 3932 kthread_prio = 0;
3930 else if (kthread_prio > 99) 3933 else if (kthread_prio > 99)
3931 kthread_prio = 99; 3934 kthread_prio = 99;
3935
3932 if (kthread_prio != kthread_prio_in) 3936 if (kthread_prio != kthread_prio_in)
3933 pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n", 3937 pr_alert("rcu_spawn_gp_kthread(): Limited prio to %d from %d\n",
3934 kthread_prio, kthread_prio_in); 3938 kthread_prio, kthread_prio_in);