aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupreempt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rcupreempt.h')
-rw-r--r--include/linux/rcupreempt.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index f04b64eca636..0967f03b0705 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -115,16 +115,21 @@ DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
115 115
116static inline void rcu_enter_nohz(void) 116static inline void rcu_enter_nohz(void)
117{ 117{
118 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
119
118 smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */ 120 smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
119 __get_cpu_var(rcu_dyntick_sched).dynticks++; 121 __get_cpu_var(rcu_dyntick_sched).dynticks++;
120 WARN_ON(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1); 122 WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs);
121} 123}
122 124
123static inline void rcu_exit_nohz(void) 125static inline void rcu_exit_nohz(void)
124{ 126{
127 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
128
125 smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ 129 smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
126 __get_cpu_var(rcu_dyntick_sched).dynticks++; 130 __get_cpu_var(rcu_dyntick_sched).dynticks++;
127 WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1)); 131 WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
132 &rs);
128} 133}
129 134
130#else /* CONFIG_NO_HZ */ 135#else /* CONFIG_NO_HZ */