diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2011-02-07 15:47:15 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-06 02:16:55 -0400 |
commit | 27f4d28057adf98750cf863c40baefb12f5b6d21 (patch) | |
tree | a66584d2cb68cebda327313f78b8f4eb602ed4ef /kernel/rcutree.h | |
parent | a26ac2455ffcf3be5c6ef92bc6df7182700f2114 (diff) |
rcu: priority boosting for TREE_PREEMPT_RCU
Add priority boosting for TREE_PREEMPT_RCU, similar to that for
TINY_PREEMPT_RCU. This is enabled by the default-off RCU_BOOST
kernel parameter. The priority to which to boost preempted
RCU readers is controlled by the RCU_BOOST_PRIO kernel parameter
(defaulting to real-time priority 1) and the time to wait before
boosting the readers who are blocking a given grace period is
controlled by the RCU_BOOST_DELAY kernel parameter (defaulting to
500 milliseconds).
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r-- | kernel/rcutree.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index c0213802d164..8db0cdc7f450 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -135,6 +135,24 @@ struct rcu_node { | |||
135 | /* if there is no such task. If there */ | 135 | /* if there is no such task. If there */ |
136 | /* is no current expedited grace period, */ | 136 | /* is no current expedited grace period, */ |
137 | /* then there can cannot be any such task. */ | 137 | /* then there can cannot be any such task. */ |
138 | #ifdef CONFIG_RCU_BOOST | ||
139 | struct list_head *boost_tasks; | ||
140 | /* Pointer to first task that needs to be */ | ||
141 | /* priority boosted, or NULL if no priority */ | ||
142 | /* boosting is needed for this rcu_node */ | ||
143 | /* structure. If there are no tasks */ | ||
144 | /* queued on this rcu_node structure that */ | ||
145 | /* are blocking the current grace period, */ | ||
146 | /* there can be no such task. */ | ||
147 | unsigned long boost_time; | ||
148 | /* When to start boosting (jiffies). */ | ||
149 | struct task_struct *boost_kthread_task; | ||
150 | /* kthread that takes care of priority */ | ||
151 | /* boosting for this rcu_node structure. */ | ||
152 | wait_queue_head_t boost_wq; | ||
153 | /* Wait queue on which to park the boost */ | ||
154 | /* kthread. */ | ||
155 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
138 | struct task_struct *node_kthread_task; | 156 | struct task_struct *node_kthread_task; |
139 | /* kthread that takes care of this rcu_node */ | 157 | /* kthread that takes care of this rcu_node */ |
140 | /* structure, for example, awakening the */ | 158 | /* structure, for example, awakening the */ |
@@ -365,7 +383,7 @@ DECLARE_PER_CPU(struct rcu_data, rcu_preempt_data); | |||
365 | static void rcu_bootup_announce(void); | 383 | static void rcu_bootup_announce(void); |
366 | long rcu_batches_completed(void); | 384 | long rcu_batches_completed(void); |
367 | static void rcu_preempt_note_context_switch(int cpu); | 385 | static void rcu_preempt_note_context_switch(int cpu); |
368 | static int rcu_preempted_readers(struct rcu_node *rnp); | 386 | static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); |
369 | #ifdef CONFIG_HOTPLUG_CPU | 387 | #ifdef CONFIG_HOTPLUG_CPU |
370 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, | 388 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, |
371 | unsigned long flags); | 389 | unsigned long flags); |
@@ -392,5 +410,16 @@ static void __cpuinit rcu_preempt_init_percpu_data(int cpu); | |||
392 | static void rcu_preempt_send_cbs_to_online(void); | 410 | static void rcu_preempt_send_cbs_to_online(void); |
393 | static void __init __rcu_init_preempt(void); | 411 | static void __init __rcu_init_preempt(void); |
394 | static void rcu_needs_cpu_flush(void); | 412 | static void rcu_needs_cpu_flush(void); |
413 | static void __init rcu_init_boost_waitqueue(struct rcu_node *rnp); | ||
414 | static void rcu_initiate_boost(struct rcu_node *rnp); | ||
415 | static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, | ||
416 | cpumask_var_t cm); | ||
417 | static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); | ||
418 | static int __cpuinit rcu_spawn_one_boost_kthread(struct rcu_state *rsp, | ||
419 | struct rcu_node *rnp, | ||
420 | int rnp_index); | ||
421 | #ifdef CONFIG_HOTPLUG_CPU | ||
422 | static void rcu_stop_boost_kthread(struct rcu_node *rnp); | ||
423 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ | ||
395 | 424 | ||
396 | #endif /* #ifndef RCU_TREE_NONCORE */ | 425 | #endif /* #ifndef RCU_TREE_NONCORE */ |