rcu: Don't disable preemption for Tiny and Tree RCU readers
[linux-block.git] / include / linux / rcupdate.h
index d63bb77dab35a4ecf56fd33e9d9ad21d93ab2876..6c3ceceb614898790d6b59219c12e81cafb287ed 100644 (file)
@@ -297,12 +297,14 @@ void synchronize_rcu(void);
 
 static inline void __rcu_read_lock(void)
 {
-       preempt_disable();
+       if (IS_ENABLED(CONFIG_PREEMPT_COUNT))
+               preempt_disable();
 }
 
 static inline void __rcu_read_unlock(void)
 {
-       preempt_enable();
+       if (IS_ENABLED(CONFIG_PREEMPT_COUNT))
+               preempt_enable();
 }
 
 static inline void synchronize_rcu(void)