diff mbox series

[04/10] sched_ext: idle: use assign_cpu() to update the idle cpumask

Message ID 20241220154107.287478-5-arighi@nvidia.com (mailing list archive)
State New
Headers show
Series [01/10] sched/topology: introduce for_each_numa_hop_node() / sched_numa_hop_node() | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andrea Righi Dec. 20, 2024, 3:11 p.m. UTC
Use the assign_cpu() helper to set or clear the CPU in the idle mask,
based on the idle condition.

Cc: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
---
 kernel/sched/ext_idle.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
index 0e57830072e4..dedd39febc88 100644
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -460,10 +460,7 @@  void __scx_update_idle(struct rq *rq, bool idle)
 			return;
 	}
 
-	if (idle)
-		cpumask_set_cpu(cpu, idle_masks.cpu);
-	else
-		cpumask_clear_cpu(cpu, idle_masks.cpu);
+	assign_cpu(cpu, idle_masks.cpu, idle);
 
 #ifdef CONFIG_SCHED_SMT
 	if (sched_smt_active()) {