Kill sched.h dependency on rcupdate.h
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 15 Dec 2023 20:51:54 +0000 (15:51 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 27 Dec 2023 16:50:20 +0000 (11:50 -0500)
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>
14 files changed:
arch/powerpc/kvm/book3s_64_vio.c
include/linux/rcupdate_wait.h
include/linux/sched.h
include/linux/sched/task.h
kernel/bpf/hashtab.c
lib/test_rhashtable.c
mm/filemap.c
mm/khugepaged.c
mm/shmem.c
net/ipv4/fib_trie.c
net/netfilter/ipset/ip_set_bitmap_gen.h
net/netfilter/ipset/ip_set_hash_gen.h
net/netfilter/ipvs/ip_vs_conn.c
net/netfilter/ipvs/ip_vs_est.c

index 14c6d7e318da598484f0a4825f7f09f564a73f0e..b569ebaa590e2d263be0db24196b6498f5f12135 100644 (file)
@@ -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>
index 5e0f74f2f8ca52818c7f860e384c2cb8f80a7693..d07f0848802e58c650371f0faf3288c3cc35f4b1 100644 (file)
@@ -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 */
index a588b94988bc4378ef351eabe9d3308bd6c53f11..814bfdafbc1caeff756a517cce606e0757227ef0 100644 (file)
 #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);
index 1880ae21a9cb7ad69884b4114f8678ef51ef35f4..538cdfbe895f9ba41eee5e33da354312cd298a36 100644 (file)
@@ -7,6 +7,7 @@
  * functionality:
  */
 
+#include <linux/rcupdate.h>
 #include <linux/refcount.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
index fd8d4b0addfca0bcd23a1bcbb440c739327a131a..3ba98ed2b3f9a5be72e2b4fac7be293c949597a9 100644 (file)
@@ -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>
index c20f6cb4bf550541ce9b423e5abaf0bbc7ff7f54..42b585208249c6d8731cb02e81ff62c5939c121d 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/kthread.h>
 #include <linux/module.h>
 #include <linux/rcupdate.h>
+#include <linux/rcupdate_wait.h>
 #include <linux/rhashtable.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
index f1c8c278310fd51384d0e5dcfd309c4aff9541ff..1219ffc04a26133abeea103e98bd4c210f49a653 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/migrate.h>
 #include <linux/pipe_fs_i.h>
 #include <linux/splice.h>
+#include <linux/rcupdate_wait.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include "internal.h"
index 064654717843ea4bff84bef4a5bd9e8f174a44d9..47a20a4ece09896403b9d28006147a9d8703a57e 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/userfaultfd_k.h>
 #include <linux/page_idle.h>
 #include <linux/page_table_check.h>
+#include <linux/rcupdate_wait.h>
 #include <linux/swapops.h>
 #include <linux/shmem_fs.h>
 #include <linux/ksm.h>
index 91e2620148b2f6d789420e6736daef7a53e2cc5c..98f6ca7bdae13e6c6a8d98892053d528217f17cd 100644 (file)
@@ -79,6 +79,7 @@ static struct vfsmount *shm_mnt __ro_after_init;
 #include <linux/rmap.h>
 #include <linux/uuid.h>
 #include <linux/quotaops.h>
+#include <linux/rcupdate_wait.h>
 
 #include <linux/uaccess.h>
 
index 9bdfdab906fe00cb048718eef932892181723a40..3ff35f811765591638c5e03d9211138ca6df3603 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/if_arp.h>
 #include <linux/proc_fs.h>
 #include <linux/rcupdate.h>
+#include <linux/rcupdate_wait.h>
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <linux/init.h>
index 26ab0e9612d82579b6e89c99704c5bbe063c0e1b..21f7860e8fa1fd4f1f46c9ad278bfeb261090152 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef __IP_SET_BITMAP_IP_GEN_H
 #define __IP_SET_BITMAP_IP_GEN_H
 
+#include <linux/rcupdate_wait.h>
+
 #define mtype_do_test          IPSET_TOKEN(MTYPE, _do_test)
 #define mtype_gc_test          IPSET_TOKEN(MTYPE, _gc_test)
 #define mtype_is_filled                IPSET_TOKEN(MTYPE, _is_filled)
index 7c2399541771fca158fc0fe598941b1037c50822..cbf80da9a01caf0616d7d77d5be16521b6c0d47e 100644 (file)
@@ -5,6 +5,7 @@
 #define _IP_SET_HASH_GEN_H
 
 #include <linux/rcupdate.h>
+#include <linux/rcupdate_wait.h>
 #include <linux/jhash.h>
 #include <linux/types.h>
 #include <linux/netfilter/nfnetlink.h>
index 9065da3cdd121d5d140046aadb723da8c20a3aef..a743db07388723b52531372d85dfa32a4ae69599 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/seq_file.h>
 #include <linux/jhash.h>
 #include <linux/random.h>
+#include <linux/rcupdate_wait.h>
 
 #include <net/net_namespace.h>
 #include <net/ip_vs.h>
index c5970ba416aea8dac9f174d5884cce4cf309bd96..f821ad2e19b35ebc11b529589592dc0f5f2af2f7 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
 #include <linux/list.h>
+#include <linux/rcupdate_wait.h>
 
 #include <net/ip_vs.h>