[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQizF0hBnM_f1nQg@jlelli-thinkpadt14gen4.remote.csb>
Date: Mon, 3 Nov 2025 14:50:15 +0100
From: Juri Lelli <juri.lelli@...hat.com>
To: Waiman Long <llong@...hat.com>
Cc: Pingfan Liu <piliu@...hat.com>, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
Pierre Gondois <pierre.gondois@....com>,
Frederic Weisbecker <frederic@...nel.org>,
Ingo Molnar <mingo@...hat.com>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
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>
Subject: Re: [PATCHv4 2/2] sched/deadline: Walk up cpuset hierarchy to decide
root domain when hot-unplug
On 29/10/25 11:31, Waiman Long wrote:
> On 10/27/25 11:43 PM, Pingfan Liu wrote:
...
> > @@ -2891,16 +2893,32 @@ void dl_add_task_root_domain(struct task_struct *p)
> > return;
> > }
> > - rq = __task_rq_lock(p, &rf);
> > -
> > + /* prevent race among cpu hotplug, changing of partition_root_state */
> > + lockdep_assert_cpus_held();
> > + /*
> > + * If @p is in blocked state, task_cpu() may be not active. In that
> > + * case, rq->rd does not trace a correct root_domain. On the other hand,
> > + * @p must belong to an root_domain at any given time, which must have
> > + * active rq, whose rq->rd traces the valid root domain.
> > + */
> > + cpuset_get_task_effective_cpus(p, &msk);
> > + cpu = cpumask_first_and(cpu_active_mask, &msk);
> > + /*
> > + * If a root domain reserves bandwidth for a DL task, the DL bandwidth
> > + * check prevents CPU hot removal from deactivating all CPUs in that
> > + * domain.
> > + */
> > + BUG_ON(cpu >= nr_cpu_ids);
> > + rq = cpu_rq(cpu);
> > + /*
> > + * This point is under the protection of cpu_hotplug_lock. Hence
> > + * rq->rd is stable.
> > + */
>
> So you trying to find a active sched domain with some dl bw to use for
> checking. I don't know enough about this dl bw checking code to know if it
> is valid or not. I will let Juri comment on that.
So, just to refresh my understanding of this issue, the task was
sleeping/blocked while the cpu it was running on before blocking has
been turned off. dl_add_task_root_domain() wrongly adds its bw
contribution to def_root_domain as it's where offline cpus are attached
to while off. We instead want to attach the sleeping task contribution
to the root domain that once comprised also the cpu it was running on
before blocking. Correct?
If that is the case, and assuming nobody touched the sleeping task
affinity (p->cpus_ptr), can't we just use another online cpu from
current task affinity to get to the right root domain? Somewhat similar
to what dl_task_offline_migration() is doing in the (!later_rq) case,
I'm thinking.
Powered by blists - more mailing lists