Skip to content

Commit

Permalink
sched/core: Merge cpumask_andnot()+for_each_cpu() into for_each_cpu_a…
Browse files Browse the repository at this point in the history
…ndnot()

This removes the second use of the sched_core_mask temporary mask.

Suggested-by: Yury Norov <[email protected]>
Signed-off-by: Valentin Schneider <[email protected]>
  • Loading branch information
valschneider authored and YuryNorov committed Oct 6, 2022
1 parent 49937cd commit 585463f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,7 @@ static void __sched_core_flip(bool enabled)
/*
* Toggle the offline CPUs.
*/
cpumask_copy(&sched_core_mask, cpu_possible_mask);
cpumask_andnot(&sched_core_mask, &sched_core_mask, cpu_online_mask);

for_each_cpu(cpu, &sched_core_mask)
for_each_cpu_andnot(cpu, cpu_possible_mask, cpu_online_mask)
cpu_rq(cpu)->core_enabled = enabled;

cpus_read_unlock();
Expand Down

0 comments on commit 585463f

Please sign in to comment.