Skip to content

Commit

Permalink
sched/fair: Use non-atomic cpumask_{set,clear}_cpu()
Browse files Browse the repository at this point in the history
The cpumasks updated here are not subject to concurrency and using
atomic bitops for them is pointless and expensive. Use the non-atomic
variants instead.

Suggested-by: Peter Zijlstra <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vincent Guittot <[email protected]>
Link: http://lkml.kernel.org/r/2e2a10f84b9049a81eef94ed6d5989447c21e34a.1549963617.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <[email protected]>
Change-Id: I7e6a86eadd39627987032d7509a105bed9852fa5
Signed-off-by: Jason Edson <[email protected]>
Signed-off-by: DennySPb <[email protected]>
Signed-off-by: Carlos Ayrton Lopez Arroyo <[email protected]>
Signed-off-by: clarencelol <[email protected]>
Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
  • Loading branch information
vireshk authored and HELLBOY017 committed Jul 20, 2023
1 parent d7f1b47 commit 938c331
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -10882,7 +10882,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) {

/* Prevent to re-select dst_cpu via env's CPUs */
cpumask_clear_cpu(env.dst_cpu, env.cpus);
__cpumask_clear_cpu(env.dst_cpu, env.cpus);

env.dst_rq = cpu_rq(env.new_dst_cpu);
env.dst_cpu = env.new_dst_cpu;
Expand All @@ -10909,7 +10909,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,

/* All tasks on this runqueue were pinned by CPU affinity */
if (unlikely(env.flags & LBF_ALL_PINNED)) {
cpumask_clear_cpu(cpu_of(busiest), cpus);
__cpumask_clear_cpu(cpu_of(busiest), cpus);
/*
* Attempting to continue load balancing at the current
* sched_domain level only makes sense if there are
Expand Down
2 changes: 1 addition & 1 deletion kernel/sched/isolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags)
cpumask_andnot(housekeeping_mask,
cpu_possible_mask, non_housekeeping_mask);
if (cpumask_empty(housekeeping_mask))
cpumask_set_cpu(smp_processor_id(), housekeeping_mask);
__cpumask_set_cpu(smp_processor_id(), housekeeping_mask);
} else {
cpumask_var_t tmp;

Expand Down

0 comments on commit 938c331

Please sign in to comment.