On 3/4/25 10:17 AM, Waiman Long wrote:
On 3/4/25 3:40 AM, 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>
---
include/linux/sched/deadline.h | 4 ++++
include/linux/sched/topology.h | 2 ++
kernel/cgroup/cpuset.c | 16 +++++++++-------
kernel/sched/deadline.c | 16 ++++++++++------
kernel/sched/topology.c | 1 +
5 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/include/linux/sched/deadline.h
b/include/linux/sched/deadline.h
index 6ec578600b24..a780068aa1a5 100644
--- a/include/linux/sched/deadline.h
+++ b/include/linux/sched/deadline.h
@@ -34,6 +34,10 @@ static inline bool dl_time_before(u64 a, u64 b)
struct root_domain;
extern void dl_add_task_root_domain(struct task_struct *p);
extern void dl_clear_root_domain(struct root_domain *rd);
+extern void dl_clear_root_domain_cpu(int cpu);
+
+extern u64 dl_cookie;
+extern bool dl_bw_visited(int cpu, u64 gen);
#endif /* CONFIG_SMP */
diff --git a/include/linux/sched/topology.h
b/include/linux/sched/topology.h
index 7f3dbafe1817..1622232bd08b 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -166,6 +166,8 @@ static inline struct cpumask
*sched_domain_span(struct sched_domain *sd)
return to_cpumask(sd->span);
}
+extern void dl_rebuild_rd_accounting(void);
+
extern void partition_sched_domains_locked(int ndoms_new,
cpumask_var_t doms_new[],
struct sched_domain_attr *dattr_new);
BTW, dl_rebuild_rd_accounting() is defined only if CONFIG_CPUSETS is
defined. I think you should move that declaration to cpuset.h and define
a proper wrapper in the else part.
Cheers,
Longman