Skip to contentSkip to conversation

sched: fix include for task_cpu_possible

PATCH In review Matthias Männich 2 participants 4 messages Sep 30, 2024 – Oct 1, 2024 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix include for task_cpu_possible

From: Matthias Maennich <[email protected]>

Commit 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()") moved the call for task_cpu_possible from kernel/sched/core.c, but did not add an include of linux/mmu_context.h where this symbol is defined. Fix that by adding the missing include.

Fixes 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()")
---
 kernel/sched/sched.h | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/sched.h +1 -0
index e2b7c5282f5d..a7832c53cc92 100644
@@ -44,6 +44,7 @@
 #include <linux/lockdep.h>
 #include <linux/minmax.h>
 #include <linux/mm.h>
+#include <linux/mmu_context.h>
 #include <linux/module.h>
 #include <linux/mutex_api.h>
 #include <linux/plist.h>
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog
#1 lore raw

Hello,

Quoted 18 lines · Matthias Männich

From: Matthias Maennich <[email protected]>

Commit 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()") moved the call for task_cpu_possible from kernel/sched/core.c, but did not add an include of linux/mmu_context.h where this symbol is defined. Fix that by adding the missing include.

Fixes 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()")
---
 kernel/sched/sched.h | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/sched.h +0 -0
index e2b7c5282f5d..a7832c53cc92 100644

kernel/sched/sched.h line 47

Quoted 4 lines
kernel/sched/sched.h +1 -0
@@ -44,6 +44,7 @@
 #include <linux/lockdep.h>
 #include <linux/minmax.h>
 #include <linux/mm.h>
+#include <linux/mmu_context.h>

Should the patch also remove mmu_context.h from kernel/sched/core.c?

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 16 lines · Tejun Heo

Hello,

Quoted 13 lines · Matthias Männich

From: Matthias Maennich <[email protected]>

Commit 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()") moved the call for task_cpu_possible from kernel/sched/core.c, but did not add an include of linux/mmu_context.h where this symbol is defined. Fix that by adding the missing include.

Fixes 2c390dda9e03 ("sched_ext: Make task_can_run_on_remote_rq() use common task_allowed_on_cpu()")
---
 kernel/sched/sched.h | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

kernel/sched/sched.h line 47

Quoted 9 lines
kernel/sched/sched.h +1 -0
index e2b7c5282f5d..a7832c53cc92 100644
@@ -44,6 +44,7 @@
 #include <linux/lockdep.h>
 #include <linux/minmax.h>
 #include <linux/mm.h>
+#include <linux/mmu_context.h>

Should the patch also remove mmu_context.h from kernel/sched/core.c?

kernel/sched/core.c has a call to switch_mm_irqs_off, which is defined in linux/mmu_context.h as well. So, no, the original include needs to remain.

Cheers,
Matthias

Quoted 5 lines

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 5 lines · Matthias Männich
Quoted 1 line

Should the patch also remove mmu_context.h from kernel/sched/core.c?

kernel/sched/core.c has a call to switch_mm_irqs_off, which is defined in linux/mmu_context.h as well. So, no, the original include needs to remain.

Hmm... I'm a bit confused. kernel/sched/core.c always includes kernel/sched/sched.h which collects all the shared includes. Why does it need to be repeated in core.c?

Thanks.

Signature · 1 line
tejun