]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/rcupreempt.h
[TCP]: tcp_simple_retransmit can cause S+L
[linux-2.6-omap-h63xx.git] / include / linux / rcupreempt.h
index 60c2a033b19e0fa7333b29d591a5f00d497a838a..d038aa6e5ee1b4dd64cba0e8e193439c16f010f7 100644 (file)
@@ -82,5 +82,27 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 
 struct softirq_action;
 
+#ifdef CONFIG_NO_HZ
+DECLARE_PER_CPU(long, dynticks_progress_counter);
+
+static inline void rcu_enter_nohz(void)
+{
+       smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
+       __get_cpu_var(dynticks_progress_counter)++;
+       WARN_ON(__get_cpu_var(dynticks_progress_counter) & 0x1);
+}
+
+static inline void rcu_exit_nohz(void)
+{
+       __get_cpu_var(dynticks_progress_counter)++;
+       smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
+       WARN_ON(!(__get_cpu_var(dynticks_progress_counter) & 0x1));
+}
+
+#else /* CONFIG_NO_HZ */
+#define rcu_enter_nohz()       do { } while (0)
+#define rcu_exit_nohz()                do { } while (0)
+#endif /* CONFIG_NO_HZ */
+
 #endif /* __KERNEL__ */
 #endif /* __LINUX_RCUPREEMPT_H */