[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a53c1601-81e7-439c-b0dd-ec009227a040@redhat.com>
Date: Tue, 4 Mar 2025 10:33:53 -0500
From: Waiman Long <llong@...hat.com>
To: Juri Lelli <juri.lelli@...hat.com>, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
Qais Yousef <qyousef@...alina.io>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Swapnil Sapkal <swapnil.sapkal@....com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>, Phil Auld <pauld@...hat.com>,
luca.abeni@...tannapisa.it, tommaso.cucinotta@...tannapisa.it,
Jon Hunter <jonathanh@...dia.com>
Subject: Re: [PATCH 4/5] sched/deadline: Rebuild root domain accounting after
every update
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@...dia.com>
>> Fixes: 53916d5fd3c0 ("sched/deadline: Check bandwidth overflow
>> earlier for hotplug")
>> Signed-off-by: Juri Lelli <juri.lelli@...hat.com>
>> ---
>> 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
Powered by blists - more mailing lists