diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2013-02-10 23:48:58 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-26 11:04:44 -0400 |
commit | dae6e64d2bcfd4b06304ab864c7e3a4f6b5fedf4 (patch) | |
tree | 79172d32aab5e0cecf8fc7ab4cf1fabf14328d81 /kernel/rcutree.h | |
parent | 911af505ef407c2511106c224dd640f882f0f590 (diff) |
rcu: Introduce proper blocking to no-CBs kthreads GP waits
Currently, the no-CBs kthreads do repeated timed waits for grace periods
to elapse. This is crude and energy inefficient, so this commit allows
no-CBs kthreads to specify exactly which grace period they are waiting
for and also allows them to block for the entire duration until the
desired grace period completes.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r-- | kernel/rcutree.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 7af39f4aaac4..e51373c0b748 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -196,6 +196,12 @@ struct rcu_node { | |||
196 | /* Refused to boost: not sure why, though. */ | 196 | /* Refused to boost: not sure why, though. */ |
197 | /* This can happen due to race conditions. */ | 197 | /* This can happen due to race conditions. */ |
198 | #endif /* #ifdef CONFIG_RCU_BOOST */ | 198 | #endif /* #ifdef CONFIG_RCU_BOOST */ |
199 | #ifdef CONFIG_RCU_NOCB_CPU | ||
200 | wait_queue_head_t nocb_gp_wq[2]; | ||
201 | /* Place for rcu_nocb_kthread() to wait GP. */ | ||
202 | int n_nocb_gp_requests[2]; | ||
203 | /* Counts of upcoming no-CB GP requests. */ | ||
204 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ | ||
199 | raw_spinlock_t fqslock ____cacheline_internodealigned_in_smp; | 205 | raw_spinlock_t fqslock ____cacheline_internodealigned_in_smp; |
200 | } ____cacheline_internodealigned_in_smp; | 206 | } ____cacheline_internodealigned_in_smp; |
201 | 207 | ||
@@ -326,7 +332,6 @@ struct rcu_data { | |||
326 | int nocb_p_count_lazy; /* (approximate). */ | 332 | int nocb_p_count_lazy; /* (approximate). */ |
327 | wait_queue_head_t nocb_wq; /* For nocb kthreads to sleep on. */ | 333 | wait_queue_head_t nocb_wq; /* For nocb kthreads to sleep on. */ |
328 | struct task_struct *nocb_kthread; | 334 | struct task_struct *nocb_kthread; |
329 | bool nocb_needs_gp; | ||
330 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ | 335 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ |
331 | 336 | ||
332 | int cpu; | 337 | int cpu; |
@@ -524,7 +529,10 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu); | |||
524 | static void print_cpu_stall_info_end(void); | 529 | static void print_cpu_stall_info_end(void); |
525 | static void zero_cpu_stall_ticks(struct rcu_data *rdp); | 530 | static void zero_cpu_stall_ticks(struct rcu_data *rdp); |
526 | static void increment_cpu_stall_ticks(void); | 531 | static void increment_cpu_stall_ticks(void); |
527 | static int rcu_nocb_needs_gp(struct rcu_data *rdp); | 532 | static int rcu_nocb_needs_gp(struct rcu_state *rsp); |
533 | static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq); | ||
534 | static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp); | ||
535 | static void rcu_init_one_nocb(struct rcu_node *rnp); | ||
528 | static bool is_nocb_cpu(int cpu); | 536 | static bool is_nocb_cpu(int cpu); |
529 | static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, | 537 | static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, |
530 | bool lazy); | 538 | bool lazy); |