]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/rcupreempt.h
fat: i_blocks warning fix
[linux-2.6-omap-h63xx.git] / include / linux / rcupreempt.h
index f04b64eca6366766d2abf74ded470bce99791e3d..3e05c09b54a22408db83e0f0a87a5a8bf9a40e8f 100644 (file)
@@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu)
        rdssp->sched_qs++;
 }
 #define rcu_bh_qsctr_inc(cpu)
-#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
+
+/*
+ * Someone might want to pass call_rcu_bh as a function pointer.
+ * So this needs to just be a rename and not a macro function.
+ *  (no parentheses)
+ */
+#define call_rcu_bh            call_rcu
 
 /**
  * call_rcu_sched - Queue RCU callback for invocation after sched grace period.
@@ -111,20 +117,24 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 struct softirq_action;
 
 #ifdef CONFIG_NO_HZ
-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
 
 static inline void rcu_enter_nohz(void)
 {
+       static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
+
        smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
        __get_cpu_var(rcu_dyntick_sched).dynticks++;
-       WARN_ON(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1);
+       WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs);
 }
 
 static inline void rcu_exit_nohz(void)
 {
-       smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
+       static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
+
        __get_cpu_var(rcu_dyntick_sched).dynticks++;
-       WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1));
+       smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
+       WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
+                               &rs);
 }
 
 #else /* CONFIG_NO_HZ */