diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-05-23 01:10:24 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-02 15:34:24 -0400 |
commit | 62fde6edf12b60fddb13a3f0a779c8be0bb7447e (patch) | |
tree | 2fa26e28ce311acb29c60f1595235240be6e7d97 /include/linux/rcupdate.h | |
parent | 28f5c693d03530eb15c5354f758b789189b98c37 (diff) |
rcu: Make __call_rcu() handle invocation from idle
Although __call_rcu() is handled correctly when called from a momentary
non-idle period, if it is called on a CPU that RCU believes to be idle
on RCU_FAST_NO_HZ kernels, the callback might be indefinitely postponed.
This commit therefore ensures that RCU is aware of the new callback and
has a chance to force the CPU out of dyntick-idle mode when a new callback
is posted.
Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
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 'include/linux/rcupdate.h')
-rw-r--r-- | include/linux/rcupdate.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 31568c734525..26f6417f0264 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -256,6 +256,10 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head) | |||
256 | } | 256 | } |
257 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 257 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
258 | 258 | ||
259 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) | ||
260 | extern int rcu_is_cpu_idle(void); | ||
261 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) */ | ||
262 | |||
259 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) | 263 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) |
260 | bool rcu_lockdep_current_cpu_online(void); | 264 | bool rcu_lockdep_current_cpu_online(void); |
261 | #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ | 265 | #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ |
@@ -267,15 +271,6 @@ static inline bool rcu_lockdep_current_cpu_online(void) | |||
267 | 271 | ||
268 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 272 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
269 | 273 | ||
270 | #ifdef CONFIG_PROVE_RCU | ||
271 | extern int rcu_is_cpu_idle(void); | ||
272 | #else /* !CONFIG_PROVE_RCU */ | ||
273 | static inline int rcu_is_cpu_idle(void) | ||
274 | { | ||
275 | return 0; | ||
276 | } | ||
277 | #endif /* else !CONFIG_PROVE_RCU */ | ||
278 | |||
279 | static inline void rcu_lock_acquire(struct lockdep_map *map) | 274 | static inline void rcu_lock_acquire(struct lockdep_map *map) |
280 | { | 275 | { |
281 | lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_); | 276 | lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_); |