[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90d1b600-6c95-418d-84af-19604ba9a7d8@intel.com>
Date: Wed, 17 Dec 2025 20:37:07 +0800
From: "Chen, Yu C" <yu.c.chen@...el.com>
To: Vern Hao <haoxing990@...il.com>
CC: Juri Lelli <juri.lelli@...hat.com>, 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>, Madadi Vineeth Reddy <vineethr@...ux.ibm.com>, "Hillf
Danton" <hdanton@...a.com>, Shrikanth Hegde <sshegde@...ux.ibm.com>,
"Jianyong Wu" <jianyong.wu@...look.com>, Yangyu Chen <cyy@...self.name>,
Tingyin Duan <tingyin.duan@...il.com>, Vern Hao <vernhao@...cent.com>, Len
Brown <len.brown@...el.com>, Aubrey Li <aubrey.li@...el.com>, Zhao Liu
<zhao1.liu@...el.com>, Chen Yu <yu.chen.surf@...il.com>, Adam Li
<adamli@...amperecomputing.com>, Aaron Lu <ziqianlu@...edance.com>, Tim Chen
<tim.c.chen@...el.com>, <linux-kernel@...r.kernel.org>, Tim Chen
<tim.c.chen@...ux.intel.com>, Peter Zijlstra <peterz@...radead.org>, "K
Prateek Nayak" <kprateek.nayak@....com>, "Gautham R . Shenoy"
<gautham.shenoy@....com>, Vincent Guittot <vincent.guittot@...aro.org>, "Ingo
Molnar" <mingo@...hat.com>
Subject: Re: [PATCH v2 06/23] sched/cache: Track LLC-preferred tasks per
runqueue
On 12/17/2025 6:04 PM, Vern Hao wrote:
>
> On 2025/12/4 07:07, Tim Chen wrote:
>> @@ -1346,8 +1385,13 @@ void account_mm_sched(struct rq *rq, struct
>> task_struct *p, s64 delta_exec)
>> #endif
>> }
>> - if (p->preferred_llc != mm_sched_llc)
>> + /* task not on rq accounted later in account_entity_enqueue() */
>> + if (task_running_on_cpu(rq->cpu, p) &&
>> + p->preferred_llc != mm_sched_llc) {
>> #ifdef CONFIG_NUMA_BALANCING
>> /*
>> * Don't assign preferred LLC if it
>> * conflicts with NUMA balancing.
>> */
>> if (p->numa_preferred_nid >= 0 &&
>> cpu_to_node(mm->mm_sched_cpu) != p-
>> >numa_preferred_nid)
>> mm_sched_llc = -1;
>> #endif
>> }
>>
>> /* task not on rq accounted later in account_entity_enqueue() */
>> if (task_running_on_cpu(rq->cpu, p) &&
>> p->preferred_llc != mm_sched_llc) {
>> account_llc_dequeue(rq, p);
>> p->preferred_llc = mm_sched_llc;
>> account_llc_enqueue(rq, p);
>>
>> }
>>
> I am a little concerned that there might be cases where both |p-
> >preferred_llc| and |mm_sched_llc| are equal to -1 at this point.", Is
> it necessary to add a check here?
>
Are you concerned about the mismatch between the percpu runqueue values
of nr_pref_llc_running, nr_pref_llc, and nr_llc_running? This should not
be an issue, because account_llc_dequeue() and account_llc_enqueue() are
always invoked together in account_mm_sched(). If p->preferred_llc =
mm_sched_llc = -1,
account_llc_dequeue/enqueue() will not be invoked, so it is still paired.
Please let me know if I understand your comments correctly.
thanks,
Chenyu
Powered by blists - more mailing lists