[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904041516.3046-15-kprateek.nayak@amd.com>
Date: Thu, 4 Sep 2025 04:15:10 +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>, <linux-kernel@...r.kernel.org>
CC: 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>
Subject: [RFC PATCH 14/19] 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 ad6e97be97d5..5e7198078d19 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -12263,18 +12263,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->idle_cpus_mask, hk_mask) {
+ if (ilb_cpu == smp_processor_id())
+ continue;
+
+ if (idle_cpu(ilb_cpu))
+ return ilb_cpu;
+ }
}
return -1;
--
2.34.1
Powered by blists - more mailing lists