[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251208092744.32737-20-kprateek.nayak@amd.com>
Date: Mon, 8 Dec 2025 09:27:06 +0000
From: K Prateek Nayak <kprateek.nayak@....com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot
<vincent.guittot@...aro.org>, Anna-Maria Behnsen <anna-maria@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>, Thomas Gleixner
<tglx@...utronix.de>
CC: <linux-kernel@...r.kernel.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>, K Prateek Nayak <kprateek.nayak@....com>, "Gautham R.
Shenoy" <gautham.shenoy@....com>, Swapnil Sapkal <swapnil.sapkal@....com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>, Chen Yu <yu.c.chen@...el.com>
Subject: [RESEND RFC PATCH v2 20/29] sched/fair: Convert find_new_ilb() to use nohz_shared_list
Use "nohz_shared_list" in find_new_ilb() instead of the global
"nohz.idle_cpus_mask".
Signed-off-by: K Prateek Nayak <kprateek.nayak@....com>
---
kernel/sched/fair.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5bbd56161838..dbbb1f3251d2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -12367,18 +12367,27 @@ static inline int on_null_domain(struct rq *rq)
*/
static inline int find_new_ilb(void)
{
+ struct sched_domain_shared *sds;
const struct cpumask *hk_mask;
- int ilb_cpu;
hk_mask = housekeeping_cpumask(HK_TYPE_KERNEL_NOISE);
- for_each_cpu_and(ilb_cpu, nohz.idle_cpus_mask, hk_mask) {
+ guard(rcu)();
+
+ list_for_each_entry_rcu(sds, &nohz_shared_list, nohz_list_node) {
+ int ilb_cpu;
- if (ilb_cpu == smp_processor_id())
+ /* No idle CPUs in this domain */
+ if (!atomic_read(&sds->nr_idle_cpus))
continue;
- if (idle_cpu(ilb_cpu))
- return ilb_cpu;
+ for_each_cpu_and(ilb_cpu, sds->nohz_idle_cpus_mask, hk_mask) {
+ if (ilb_cpu == smp_processor_id())
+ continue;
+
+ if (idle_cpu(ilb_cpu))
+ return ilb_cpu;
+ }
}
return -1;
--
2.43.0
Powered by blists - more mailing lists