sched: add cond_resched_rcu() helper
[platform/adaptation/renesas_rcar/renesas_kernel.git] / include / linux / sched.h
index 178a8d9..4ff8da1 100644 (file)
@@ -2444,6 +2444,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,