diff options
author | Clark Williams <clark.williams@gmail.com> | 2014-09-12 22:21:09 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-10-29 13:19:41 -0400 |
commit | 21871d7eff2c96ae67e18e00adf59d56940e2fcc (patch) | |
tree | e1d6d5c5b7e1f3b70715451c1a04f591293fb474 /kernel | |
parent | e0775cefb5ede661dbdc0611d7bf3fcd4640005c (diff) |
rcu: Unify boost and kthread priorities
Rename CONFIG_RCU_BOOST_PRIO to CONFIG_RCU_KTHREAD_PRIO and use this
value for both the per-CPU kthreads (rcuc/N) and the rcu boosting
threads (rcub/n).
Also, create the module_parameter rcutree.kthread_prio to be used on
the kernel command line at boot to set a new value (rcutree.kthread_prio=N).
Signed-off-by: Clark Williams <clark.williams@gmail.com>
[ paulmck: Ported to rcu/dev, applied Paul Bolle and Peter Zijlstra feedback. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcu/tree_plugin.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 357891104ea0..344f0e661515 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -30,12 +30,13 @@ | |||
30 | #include <linux/smpboot.h> | 30 | #include <linux/smpboot.h> |
31 | #include "../time/tick-internal.h" | 31 | #include "../time/tick-internal.h" |
32 | 32 | ||
33 | #define RCU_KTHREAD_PRIO 1 | ||
34 | |||
35 | #ifdef CONFIG_RCU_BOOST | 33 | #ifdef CONFIG_RCU_BOOST |
36 | 34 | ||
37 | #include "../locking/rtmutex_common.h" | 35 | #include "../locking/rtmutex_common.h" |
38 | #define RCU_BOOST_PRIO CONFIG_RCU_BOOST_PRIO | 36 | |
37 | /* rcuc/rcub kthread realtime priority */ | ||
38 | static int kthread_prio = CONFIG_RCU_KTHREAD_PRIO; | ||
39 | module_param(kthread_prio, int, 0644); | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * Control variables for per-CPU and per-rcu_node kthreads. These | 42 | * Control variables for per-CPU and per-rcu_node kthreads. These |
@@ -46,11 +47,7 @@ DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_status); | |||
46 | DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); | 47 | DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); |
47 | DEFINE_PER_CPU(char, rcu_cpu_has_work); | 48 | DEFINE_PER_CPU(char, rcu_cpu_has_work); |
48 | 49 | ||
49 | #else /* #ifdef CONFIG_RCU_BOOST */ | 50 | #endif /* #ifdef CONFIG_RCU_BOOST */ |
50 | |||
51 | #define RCU_BOOST_PRIO RCU_KTHREAD_PRIO | ||
52 | |||
53 | #endif /* #else #ifdef CONFIG_RCU_BOOST */ | ||
54 | 51 | ||
55 | #ifdef CONFIG_RCU_NOCB_CPU | 52 | #ifdef CONFIG_RCU_NOCB_CPU |
56 | static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ | 53 | static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ |
@@ -98,6 +95,9 @@ static void __init rcu_bootup_announce_oddness(void) | |||
98 | pr_info("\tBoot-time adjustment of leaf fanout to %d.\n", rcu_fanout_leaf); | 95 | pr_info("\tBoot-time adjustment of leaf fanout to %d.\n", rcu_fanout_leaf); |
99 | if (nr_cpu_ids != NR_CPUS) | 96 | if (nr_cpu_ids != NR_CPUS) |
100 | pr_info("\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); | 97 | pr_info("\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); |
98 | #ifdef CONFIG_RCU_BOOST | ||
99 | pr_info("\tRCU kthread priority: %d.\n", kthread_prio); | ||
100 | #endif | ||
101 | } | 101 | } |
102 | 102 | ||
103 | #ifdef CONFIG_TREE_PREEMPT_RCU | 103 | #ifdef CONFIG_TREE_PREEMPT_RCU |
@@ -1339,7 +1339,7 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, | |||
1339 | smp_mb__after_unlock_lock(); | 1339 | smp_mb__after_unlock_lock(); |
1340 | rnp->boost_kthread_task = t; | 1340 | rnp->boost_kthread_task = t; |
1341 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 1341 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1342 | sp.sched_priority = RCU_BOOST_PRIO; | 1342 | sp.sched_priority = kthread_prio; |
1343 | sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); | 1343 | sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); |
1344 | wake_up_process(t); /* get to TASK_INTERRUPTIBLE quickly. */ | 1344 | wake_up_process(t); /* get to TASK_INTERRUPTIBLE quickly. */ |
1345 | return 0; | 1345 | return 0; |
@@ -1356,7 +1356,7 @@ static void rcu_cpu_kthread_setup(unsigned int cpu) | |||
1356 | { | 1356 | { |
1357 | struct sched_param sp; | 1357 | struct sched_param sp; |
1358 | 1358 | ||
1359 | sp.sched_priority = RCU_KTHREAD_PRIO; | 1359 | sp.sched_priority = kthread_prio; |
1360 | sched_setscheduler_nocheck(current, SCHED_FIFO, &sp); | 1360 | sched_setscheduler_nocheck(current, SCHED_FIFO, &sp); |
1361 | } | 1361 | } |
1362 | 1362 | ||