On Wed, Sep 03, 2025 at 05:15:18PM +0200, Juri Lelli wrote: > On 03/09/25 17:10, Andrea Righi wrote: > > On Wed, Sep 03, 2025 at 04:53:59PM +0200, Juri Lelli wrote: > > > Hi, > > > > > > On 03/09/25 11:33, Andrea Righi wrote: > > > > From: Joel Fernandes <joelagnelf@xxxxxxxxxx> > > > > > > > > Hotplugged CPUs coming online do an enqueue but are not a part of any > > > > root domain containing cpu_active() CPUs. So in this case, don't mess > > > > with accounting and we can retry later. Without this patch, we see > > > > crashes with sched_ext selftest's hotplug test due to divide by zero. > > > > > > > > Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx> > > > > --- > > > > kernel/sched/deadline.c | 7 ++++++- > > > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > > > > index 3c478a1b2890d..753e50b1e86fc 100644 > > > > --- a/kernel/sched/deadline.c > > > > +++ b/kernel/sched/deadline.c > > > > @@ -1689,7 +1689,12 @@ int dl_server_apply_params(struct sched_dl_entity *dl_se, u64 runtime, u64 perio > > > > cpus = dl_bw_cpus(cpu); > > > > cap = dl_bw_capacity(cpu); > > > > > > > > - if (__dl_overflow(dl_b, cap, old_bw, new_bw)) > > > > + /* > > > > + * Hotplugged CPUs coming online do an enqueue but are not a part of any > > > > + * root domain containing cpu_active() CPUs. So in this case, don't mess > > > > + * with accounting and we can retry later. > > > > + */ > > > > + if (!cpus || __dl_overflow(dl_b, cap, old_bw, new_bw)) > > > > return -EBUSY; > > > > > > > > if (init) { > > > > > > Yuri is proposing to ignore dl-servers bandwidth contribution from > > > admission control (as they essentially operate on the remaining > > > bandwidth portion not available to RT/DEADLINE tasks): > > > > > > https://lore.kernel.org/lkml/20250903114448.664452-1-yurand2000@xxxxxxxxx/ > > > > > > His patch should make this patch not required. Would you be able and > > > willing to test this assumption? > > > > I'll run some tests with Yuri's patch applied and dropping this one (and we > > may also need to drop "[PATCH 10/16] sched/deadline: Account ext server > > bandwidth"). > > Please mind that Yuri's change is still under discussion! :)) > > I just wanted to mention it here as it might change how we account for > dl-servers if we decide to go that way. That's fine, I've already done a quick test. :) It seems to work (more or less), meaning that in case of RT/sched_ext contention the sched_ext tasks seem to get the right amount of CPU bandwidth (5%), but the total_bw kselftest is quite broken and it's always reporting a bw value of 0... in any case, even if we go this way there's no major disruption apparently. -Andrea