Re: [PATCH v6 05/37] sched/deadline: Refuse dl_server debugfs writes while the rq is offline
From: Mathieu Desnoyers
Date: Tue Nov 17 2026 - 09:19:11 EST
> Can a debugfs write still slip through during sched_cpu_deactivate() after
> cpu_active(cpu) is cleared?
Yes, it can pass in that window. It leaves no wrong state, though.
> if other active CPUs remain, __dl_overflow() checks N servers against
> N - 1 CPUs' capacity and __dl_sub() / __dl_add() miscalculate extra_bw
> across N - 1 CPUs.
The test against the N - 1 CPUs that remain is the safe side.
dl_bw_deactivate() just made the same test. __dl_update() spreads
extra_bw over the active CPUs only, so the divisor matches the CPUs it
updates. With no active CPU left, any bandwidth above 0 is refused.
The rebuild at the end of sched_cpu_deactivate() then resets total_bw
and extra_bw. So the write lasts until the end of the same call.
> dl_server_start() also re-enqueues the server on the
> deactivating runqueue after balance_push_set(cpu, true).
The rq is still online there. Any fair enqueue on that CPU starts the
server in the same window.
So the planned next version keeps the rq->online test as it is.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com