Commit c89d92ed authored by Viresh Kumar's avatar Viresh Kumar Committed by Ingo Molnar

sched/fair: Use non-atomic cpumask_{set,clear}_cpu()

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: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: http://lkml.kernel.org/r/2e2a10f84b9049a81eef94ed6d5989447c21e34a.1549963617.git.viresh.kumar@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 1b5500d7
...@@ -6097,7 +6097,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int ...@@ -6097,7 +6097,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int
bool idle = true; bool idle = true;
for_each_cpu(cpu, cpu_smt_mask(core)) { for_each_cpu(cpu, cpu_smt_mask(core)) {
cpumask_clear_cpu(cpu, cpus); __cpumask_clear_cpu(cpu, cpus);
if (!available_idle_cpu(cpu)) if (!available_idle_cpu(cpu))
idle = false; idle = false;
} }
...@@ -9105,7 +9105,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, ...@@ -9105,7 +9105,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) { if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) {
/* Prevent to re-select dst_cpu via env's CPUs */ /* 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_rq = cpu_rq(env.new_dst_cpu);
env.dst_cpu = env.new_dst_cpu; env.dst_cpu = env.new_dst_cpu;
...@@ -9132,7 +9132,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, ...@@ -9132,7 +9132,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
/* All tasks on this runqueue were pinned by CPU affinity */ /* All tasks on this runqueue were pinned by CPU affinity */
if (unlikely(env.flags & LBF_ALL_PINNED)) { 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 * Attempting to continue load balancing at the current
* sched_domain level only makes sense if there are * sched_domain level only makes sense if there are
......
...@@ -80,7 +80,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags) ...@@ -80,7 +80,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags)
cpumask_andnot(housekeeping_mask, cpumask_andnot(housekeeping_mask,
cpu_possible_mask, non_housekeeping_mask); cpu_possible_mask, non_housekeeping_mask);
if (cpumask_empty(housekeeping_mask)) if (cpumask_empty(housekeeping_mask))
cpumask_set_cpu(smp_processor_id(), housekeeping_mask); __cpumask_set_cpu(smp_processor_id(), housekeeping_mask);
} else { } else {
cpumask_var_t tmp; cpumask_var_t tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment