Re: [PATCH 2/2] sched/deadline: Skip bandwidth accounting with SCHED_FLAG_KEEP_PARAMS

From: Peter Zijlstra

Date: Thu Jul 30 2026 - 06:06:01 EST


On Thu, Jul 30, 2026 at 07:56:31AM +0200, Andrea Righi wrote:
> A sched_setattr() invocation targeting a non-deadline task can specify
> SCHED_DEADLINE together with SCHED_FLAG_KEEP_PARAMS. The flag prevents
> __sched_setscheduler() from applying the requested parameters or class,
> but deadline admission runs before the guarded update and immediately
> accounts the requested bandwidth in the root domain. Repeating the
> invocation can therefore consume bandwidth without creating a deadline
> task capable of releasing it.
>
> Skip deadline bandwidth admission when SCHED_FLAG_KEEP_PARAMS is set,
> since neither the deadline policy nor its parameters will change.

I'm thinking this should be fixed by simply not allowing KEEP_PARAM when
the policy changes, no?