[PATCH v2 2/2] sched/deadline: Reject debugfs dl_server writes for inactive CPUs

From: Hui Su

Date: Sat Sep 19 2026 - 11:33:26 EST


Commit 4043f5498416 ("sched/deadline: Reject debugfs dl_server writes
for offline CPUs") rejects per-CPU DL server parameter updates once the
target CPU is offline.

During CPU hot-unplug, however, the CPU is cleared from cpu_active_mask
before it is marked offline. This leaves a window where the CPU is no
longer active but cpu_online() still returns true, so
sched_server_write_common() continues to accept DL server updates.

There is no meaningful reason to reconfigure a per-CPU DL server once the
CPU is being deactivated. Reject the write when the target CPU is inactive
rather than only after it becomes offline.

Fixes: d741f297bcea ("sched/fair: Fair server interface")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Link: https://lore.kernel.org/r/anw7IML1xzHys6re@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM
Signed-off-by: Hui Su <sh_def@xxxxxxx>
---
kernel/sched/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 72236db67983..0e1642adb58c 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -416,7 +416,7 @@ static ssize_t sched_server_write_common(struct file *filp, const char __user *u
return -EINVAL;
}

- if (!cpu_online(cpu_of(rq)))
+ if (!cpu_active(cpu_of(rq)))
return -EBUSY;

update_rq_clock(rq);
--
2.55.0