[PATCH v5 2/4] rcu: replace preempt.h with sched.h in include/linux/rcupdate.h

Menglong Dong posted 4 patches 2 weeks, 1 day ago
[PATCH v5 2/4] rcu: replace preempt.h with sched.h in include/linux/rcupdate.h
Posted by Menglong Dong 2 weeks, 1 day ago
In the next commit, we will move the definition of migrate_enable() and
migrate_disable() to linux/sched.h. However,
migrate_enable/migrate_disable will be used in commit
1b93c03fb319 ("rcu: add rcu_read_lock_dont_migrate()") in bpf-next tree.

In order to fix potential compiling error, replace linux/preempt.h with
linux/sched.h in include/linux/rcupdate.h.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
---
 include/linux/rcupdate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 120536f4c6eb..8f346c847ee5 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -24,7 +24,7 @@
 #include <linux/compiler.h>
 #include <linux/atomic.h>
 #include <linux/irqflags.h>
-#include <linux/preempt.h>
+#include <linux/sched.h>
 #include <linux/bottom_half.h>
 #include <linux/lockdep.h>
 #include <linux/cleanup.h>
-- 
2.51.0
Re: [PATCH v5 2/4] rcu: replace preempt.h with sched.h in include/linux/rcupdate.h
Posted by Peter Zijlstra 2 weeks ago
On Wed, Sep 17, 2025 at 02:09:14PM +0800, Menglong Dong wrote:

> 1b93c03fb319 ("rcu: add rcu_read_lock_dont_migrate()") in bpf-next tree.

FWIW that commit has migrate and rcu not nicely scoped. It doesn't
really matter, but it caused my brain to raise an exception when looking
at it.

Anyway, let me go queue these patches, see what happens :-)