aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupreempt.h
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-02-29 12:46:50 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-29 12:46:50 -0500
commit2232c2d8e0a6a31061dec311f3d1cf7624bc14f1 (patch)
tree1d90ec0b8bd4e3c154e386f005ef596ee25fa53f /include/linux/rcupreempt.h
parentc0f4133b8f70769bc8dda977feb9a29109d6ccca (diff)
rcu: add support for dynamic ticks and preempt rcu
The PREEMPT-RCU can get stuck if a CPU goes idle and NO_HZ is set. The idle CPU will not progress the RCU through its grace period and a synchronize_rcu my get stuck. Without this patch I have a box that will not boot when PREEMPT_RCU and NO_HZ are set. That same box boots fine with this patch. This patch comes from the -rt kernel where it has been tested for several months. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/rcupreempt.h')
-rw-r--r--include/linux/rcupreempt.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 60c2a033b19e..01152ed532c8 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -82,5 +82,27 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
82 82
83struct softirq_action; 83struct softirq_action;
84 84
85#ifdef CONFIG_NO_HZ
86DECLARE_PER_CPU(long, dynticks_progress_counter);
87
88static inline void rcu_enter_nohz(void)
89{
90 __get_cpu_var(dynticks_progress_counter)++;
91 WARN_ON(__get_cpu_var(dynticks_progress_counter) & 0x1);
92 mb();
93}
94
95static inline void rcu_exit_nohz(void)
96{
97 mb();
98 __get_cpu_var(dynticks_progress_counter)++;
99 WARN_ON(!(__get_cpu_var(dynticks_progress_counter) & 0x1));
100}
101
102#else /* CONFIG_NO_HZ */
103#define rcu_enter_nohz() do { } while (0)
104#define rcu_exit_nohz() do { } while (0)
105#endif /* CONFIG_NO_HZ */
106
85#endif /* __KERNEL__ */ 107#endif /* __KERNEL__ */
86#endif /* __LINUX_RCUPREEMPT_H */ 108#endif /* __LINUX_RCUPREEMPT_H */