[PATCH 5/7] sched/topology: Remove CPUs with NULL sd from HKR_TYPE_SCHED mask
From: Pierre Gondois
Date: Wed Apr 03 2024 - 11:07:56 EST
Upon attaching a NULL sched domain to a CPU, remove the CPU from
the HKR_TYPE_SCHED isolation mask. CPUs present in this mask
are prevented from being added to the fair.c variables:
- nohz.idle_cpus_mask
- nohz.nr_cpus
Signed-off-by: Pierre Gondois <pierre.gondois@xxxxxxx>
---
kernel/sched/topology.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 63aecd2a7a9f..b4fc212ccfb0 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -775,6 +775,11 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
sched_domain_debug(sd, cpu);
+ if (sd)
+ housekeeping_runtime_set_cpu(cpu, HKR_TYPE_SCHED);
+ else
+ housekeeping_runtime_clear_cpu(cpu, HKR_TYPE_SCHED);
+
rq_attach_root(rq, rd);
tmp = rq->sd;
rcu_assign_pointer(rq->sd, sd);
--
2.25.1