[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SI2PR04MB493156DFBDC742811128E088E384A@SI2PR04MB4931.apcprd04.prod.outlook.com>
Date: Wed, 7 Jan 2026 12:49:49 +0800
From: Jianyong Wu <jianyong.wu@...look.com>
To: Tim Chen <tim.c.chen@...ux.intel.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>,
Yangyu Chen <cyy@...self.name>, Tingyin Duan <tingyin.duan@...il.com>,
Vern Hao <vernhao@...cent.com>, Vern Hao <haoxing990@...il.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>,
Chen Yu <yu.c.chen@...el.com>, Adam Li <adamli@...amperecomputing.com>,
Aaron Lu <ziqianlu@...edance.com>, Tim Chen <tim.c.chen@...el.com>,
linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, K Prateek Nayak <kprateek.nayak@....com>,
"Gautham R . Shenoy" <gautham.shenoy@....com>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH v2 05/23] sched/cache: Assign preferred LLC ID to
processes
Hi Tim,
On 12/4/2025 7:07 AM, Tim Chen wrote:
> With cache-aware scheduling enabled, each task is assigned a
> preferred LLC ID. This allows quick identification of the LLC domain
> where the task prefers to run, similar to numa_preferred_nid in
> NUMA balancing.
>
> Signed-off-by: Tim Chen <tim.c.chen@...ux.intel.com>
> ---
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0a3918269906..10cec83f65d5 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1300,6 +1300,7 @@ void account_mm_sched(struct rq *rq, struct task_struct *p, s64 delta_exec)
> struct mm_struct *mm = p->mm;
> struct mm_sched *pcpu_sched;
> unsigned long epoch;
> + int mm_sched_llc = -1;
>
> if (!sched_cache_enabled())
> return;
> @@ -1330,6 +1331,23 @@ void account_mm_sched(struct rq *rq, struct task_struct *p, s64 delta_exec)
> if (mm->mm_sched_cpu != -1)
> mm->mm_sched_cpu = -1;
> }
> +
> + if (mm->mm_sched_cpu != -1) {
> + mm_sched_llc = llc_id(mm->mm_sched_cpu);
> +
> +#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;
Scenario: NUMA balancing is initially enabled and numa_preferred_nid is
set. After disabling NUMA balancing, numa_preferred_nid is not cleared,
leading to unintended impact of NUMA balancing on cache-aware
scheduling. Should we check if NUMA balancing is disabled before
checking numa_preferred_nid?
Thanks
Jianyong Wu
> +#endif
> + }
> +
> + if (p->preferred_llc != mm_sched_llc)
> + p->preferred_llc = mm_sched_llc;
> }
>
> static void task_tick_cache(struct rq *rq, struct task_struct *p)
Powered by blists - more mailing lists