Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[cascardo/linux.git] / include / linux / sched.h
index 75324d8..f99d57e 100644 (file)
@@ -2434,6 +2434,15 @@ extern int __cond_resched_softirq(void);
        __cond_resched_softirq();                                       \
 })
 
+static inline void cond_resched_rcu(void)
+{
+#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU)
+       rcu_read_unlock();
+       cond_resched();
+       rcu_read_lock();
+#endif
+}
+
 /*
  * Does a critical section need to be broken due to another
  * task waiting?: (technically does not depend on CONFIG_PREEMPT,