Re: [PATCH v2 4/8] sched/deadline: Rebuild root domain accounting after every update
From: Juri Lelli
Date: Fri Mar 07 2025 - 03:59:34 EST
On 07/03/25 13:02, Shrikanth Hegde wrote:
>
>
> On 3/6/25 19:40, Juri Lelli wrote:
> > Rebuilding of root domains accounting information (total_bw) is
> > currently broken on some cases, e.g. suspend/resume on aarch64. Problem
> > is that the way we keep track of domain changes and try to add bandwidth
> > back is convoluted and fragile.
> >
> > Fix it by simplify things by making sure bandwidth accounting is cleared
> > and completely restored after root domains changes (after root domains
> > are again stable).
> >
> > Reported-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for hotplug")
> > Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
...
> > @@ -965,11 +967,12 @@ static void dl_rebuild_rd_accounting(void)
> > rcu_read_lock();
> > - /*
> > - * Clear default root domain DL accounting, it will be computed again
> > - * if a task belongs to it.
> > - */
> > - dl_clear_root_domain(&def_root_domain);
> > + for_each_possible_cpu(cpu) {
> > + if (dl_bw_visited(cpu, cookie))
> > + continue;
> > +
> > + dl_clear_root_domain_cpu(cpu);
> > + }
>
> This will clear all possible root domains bandwidth and rebuild it.
>
> For an online CPUs, the fair server bandwidth is added i think in
> rq_attach_root. But for an offline CPUs the sched domains wont be rebuilt.
> It may not be an issue. but the def_root_domain's bw may be different
> afterwords. no?
dl_clear_root_domain() actually adds DL servers contribution back on
their domains (dynamic and def) and we want to keep offline CPUs DL
server contribution not accounted for until they come back online and
the domains are rebuilt.
Thanks,
Juri