sched/deadline: Rebuild root domain accounting after every update
authorJuri Lelli <juri.lelli@redhat.com>
Thu, 13 Mar 2025 17:10:21 +0000 (18:10 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Mar 2025 10:23:42 +0000 (11:23 +0100)
commit2ff899e3516437354204423ef0a94994717b8e6a
tree1e9fc392a4f839351bf9575c84ff1ece95c41cdf
parent45007c6fb5860cf63556a9cadc87c8984927e23d
sched/deadline: Rebuild root domain accounting after every update

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).

To be sure we always call dl_rebuild_rd_accounting while holding
cpuset_mutex we also add cpuset_reset_sched_domains() wrapper.

Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow earlier for hotplug")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Co-developed-by: Waiman Long <llong@redhat.com>
Signed-off-by: Waiman Long <llong@redhat.com>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lore.kernel.org/r/Z9MRfeJKJUOyUSto@jlelli-thinkpadt14gen4.remote.csb
include/linux/cpuset.h
include/linux/sched/deadline.h
include/linux/sched/topology.h
kernel/cgroup/cpuset.c
kernel/sched/core.c
kernel/sched/deadline.c
kernel/sched/topology.c