X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Frcupreempt.h;h=8a05c7e20bc4e780c7765d34a2f9abda11436658;hb=d67c6f869c0a7f275689855161c93d714197e052;hp=60c2a033b19e0fa7333b29d591a5f00d497a838a;hpb=3668805a544a6229d6135a4427b8dfe7c343b61f;p=linux-2.6 diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 60c2a033b1..8a05c7e20b 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h @@ -33,8 +33,6 @@ #ifndef __LINUX_RCUPREEMPT_H #define __LINUX_RCUPREEMPT_H -#ifdef __KERNEL__ - #include #include #include @@ -82,5 +80,26 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); struct softirq_action; -#endif /* __KERNEL__ */ +#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 /* __LINUX_RCUPREEMPT_H */