diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-15 23:51:54 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-27 19:50:20 +0300 |
commit | 1e2f2d31997a9496f99e2b43255d6a48b06fbcc2 (patch) | |
tree | b2477645a8943813f1b934405e8238a76814d3b0 /include/linux/rcupdate_wait.h | |
parent | e717ceb529653891f2283e2fd783edbb231e3562 (diff) | |
download | linux-1e2f2d31997a9496f99e2b43255d6a48b06fbcc2.tar.xz |
Kill sched.h dependency on rcupdate.h
by moving cond_resched_rcu() to rcupdate_wait.h, we can kill another big
sched.h dependency.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'include/linux/rcupdate_wait.h')
-rw-r--r-- | include/linux/rcupdate_wait.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h index 5e0f74f2f8ca..d07f0848802e 100644 --- a/include/linux/rcupdate_wait.h +++ b/include/linux/rcupdate_wait.h @@ -8,6 +8,7 @@ #include <linux/rcupdate.h> #include <linux/completion.h> +#include <linux/sched.h> /* * Structure allowing asynchronous waiting on RCU. @@ -55,4 +56,13 @@ do { \ #define synchronize_rcu_mult(...) \ _wait_rcu_gp(IS_ENABLED(CONFIG_TINY_RCU), __VA_ARGS__) +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 +} + #endif /* _LINUX_SCHED_RCUPDATE_WAIT_H */ |