Commit 1e2f2d31 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e717ceb5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/iommu.h>
#include <linux/file.h>
#include <linux/mm.h>
#include <linux/rcupdate_wait.h>

#include <asm/kvm_ppc.h>
#include <asm/kvm_book3s.h>
+10 −0
Original line number Diff line number Diff line
@@ -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 */
+5 −10
Original line number Diff line number Diff line
@@ -10,9 +10,14 @@
#include <uapi/linux/sched.h>

#include <asm/current.h>
#include <asm/processor.h>
#include <linux/thread_info.h>
#include <linux/preempt.h>
#include <linux/cpumask.h>

#include <linux/cache.h>
#include <linux/irqflags_types.h>
#include <linux/smp_types.h>
#include <linux/pid_types.h>
#include <linux/sem_types.h>
#include <linux/shm.h>
@@ -23,7 +28,6 @@
#include <linux/timer_types.h>
#include <linux/seccomp_types.h>
#include <linux/nodemask_types.h>
#include <linux/rcupdate.h>
#include <linux/refcount_types.h>
#include <linux/resource.h>
#include <linux/latencytop.h>
@@ -2059,15 +2063,6 @@ extern int __cond_resched_rwlock_write(rwlock_t *lock);
	__cond_resched_rwlock_write(lock);					\
})

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
}

#ifdef CONFIG_PREEMPT_DYNAMIC

extern bool preempt_model_none(void);
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 * functionality:
 */

#include <linux/rcupdate.h>
#include <linux/refcount.h>
#include <linux/sched.h>
#include <linux/uaccess.h>
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/jhash.h>
#include <linux/filter.h>
#include <linux/rculist_nulls.h>
#include <linux/rcupdate_wait.h>
#include <linux/random.h>
#include <uapi/linux/btf.h>
#include <linux/rcupdate_trace.h>
Loading