Re: [PATCHSET v3 sched_ext/for-7.2] sched_ext: Auto-manage ext/fair dl_server bandwidth

From: Peter Zijlstra

Date: Thu May 28 2026 - 07:37:09 EST


On Wed, May 27, 2026 at 02:36:18PM +0200, Juri Lelli wrote:
> Hi Andrea,
>
> On 26/05/26 18:42, Andrea Righi wrote:
> > Currently, a fixed bandwidth is reserved at boot for both the fair and ext
> > deadline servers, and this reservation remains unchanged unless explicitly
> > modified via debugfs. As a result, both servers permanently contribute to global
> > bandwidth accounting, regardless of whether a BPF scheduler is active.
> >
> > While unused bandwidth can still be reclaimed at runtime by other classes, this
> > static reservation prevents RT from fully utilizing available headroom in
> > situations where one of the sched_ext or fair class is guaranteed to be inactive
> > (for example, when no BPF scheduler is loaded, or when sched_ext runs in full
> > mode and replaces fair).
> >
> > As discussed at the VIII OSPM summit in Cambridge [1], a better solution would
> > be to dynamically register and unregister deadline server bandwidth based on the
> > active sched_ext state. This allows the kernel to automatically enable bandwidth
> > accounting only for the scheduling class that is currently active, while
> > disabling it for inactive ones.
> >
> > This patch series implements this automatic register/unregister logic. Moreover,
> > the sched_ext total_bw kselftest is also modified to validate the correct
> > behavior across the different scheduling configurations and ensure that
> > bandwidth accounting follows the expected state transitions.
> >
> > [1] https://retis.santannapisa.it/ospm-summit/
> >
> > Git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arighi/linux.git dl-server-bw-v3
> >
> > Changes in v3:
> > - Don't bypass __dl_overflow() for detached servers in dl_server_apply_params()
> > to reject oversized configs up front (reported by Sashiko)
> > - A potential divide-by-zero in dl_server_apply_params() reported by Sashiko
> > has been fixed in a separate patch (not introduced by this patch set):
> > https://lore.kernel.org/all/20260526100502.575774-1-arighi@xxxxxxxxxx/
> > - Link to v2: https://lore.kernel.org/all/20260526082954.550958-1-arighi@xxxxxxxxxx/
>
> This looks now good to me.
>
> Acked-by: Juri Lelli <juri.lelli@xxxxxxxxxx>

Thanks!, I've stuck them in queue:sched/core for the robots to chew on.
There was an absolutely trivial reject in ext.c that I fixed up, so
something moved around there.

There is one little nit, but I'll reply there and that can easily be
done on top if we decide its worth it.