aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2019-02-12 04:27:01 -0500
committerIngo Molnar <mingo@kernel.org>2019-02-13 02:34:13 -0500
commitc89d92eddfad11e912fb506f85e1796064a9f9d2 (patch)
tree475797f3ce1899bad0098b86a7ca61a1fe5587e5
parent1b5500d73466c62fe048153f0cea1610d2543c7f (diff)
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: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Viresh 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.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c6
-rw-r--r--kernel/sched/isolation.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8abd1c271499..8213ff6e365d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6097,7 +6097,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int
6097 bool idle = true; 6097 bool idle = true;
6098 6098
6099 for_each_cpu(cpu, cpu_smt_mask(core)) { 6099 for_each_cpu(cpu, cpu_smt_mask(core)) {
6100 cpumask_clear_cpu(cpu, cpus); 6100 __cpumask_clear_cpu(cpu, cpus);
6101 if (!available_idle_cpu(cpu)) 6101 if (!available_idle_cpu(cpu))
6102 idle = false; 6102 idle = false;
6103 } 6103 }
@@ -9105,7 +9105,7 @@ more_balance:
9105 if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) { 9105 if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) {
9106 9106
9107 /* Prevent to re-select dst_cpu via env's CPUs */ 9107 /* Prevent to re-select dst_cpu via env's CPUs */
9108 cpumask_clear_cpu(env.dst_cpu, env.cpus); 9108 __cpumask_clear_cpu(env.dst_cpu, env.cpus);
9109 9109
9110 env.dst_rq = cpu_rq(env.new_dst_cpu); 9110 env.dst_rq = cpu_rq(env.new_dst_cpu);
9111 env.dst_cpu = env.new_dst_cpu; 9111 env.dst_cpu = env.new_dst_cpu;
@@ -9132,7 +9132,7 @@ more_balance:
9132 9132
9133 /* All tasks on this runqueue were pinned by CPU affinity */ 9133 /* All tasks on this runqueue were pinned by CPU affinity */
9134 if (unlikely(env.flags & LBF_ALL_PINNED)) { 9134 if (unlikely(env.flags & LBF_ALL_PINNED)) {
9135 cpumask_clear_cpu(cpu_of(busiest), cpus); 9135 __cpumask_clear_cpu(cpu_of(busiest), cpus);
9136 /* 9136 /*
9137 * Attempting to continue load balancing at the current 9137 * Attempting to continue load balancing at the current
9138 * sched_domain level only makes sense if there are 9138 * sched_domain level only makes sense if there are
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 81faddba9e20..b02d148e7672 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -80,7 +80,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags)
80 cpumask_andnot(housekeeping_mask, 80 cpumask_andnot(housekeeping_mask,
81 cpu_possible_mask, non_housekeeping_mask); 81 cpu_possible_mask, non_housekeeping_mask);
82 if (cpumask_empty(housekeeping_mask)) 82 if (cpumask_empty(housekeeping_mask))
83 cpumask_set_cpu(smp_processor_id(), housekeeping_mask); 83 __cpumask_set_cpu(smp_processor_id(), housekeeping_mask);
84 } else { 84 } else {
85 cpumask_var_t tmp; 85 cpumask_var_t tmp;
86 86