diff options
author | Valentin Schneider <valentin.schneider@arm.com> | 2018-07-04 12:17:46 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-09-10 11:05:52 +0200 |
commit | e90c8fe15a3bf93a23088bcf1a56a0fa391d4e50 (patch) | |
tree | a04280c786bd43f82cb01576a8d8ff5786bb69a6 /kernel/sched/sched.h | |
parent | sched/core: Change root_domain->overload type to int (diff) | |
download | linux-e90c8fe15a3bf93a23088bcf1a56a0fa391d4e50.tar.xz linux-e90c8fe15a3bf93a23088bcf1a56a0fa391d4e50.zip |
sched/fair: Wrap rq->rd->overload accesses with READ/WRITE_ONCE()
This variable can be read and set locklessly within update_sd_lb_stats().
As such, READ/WRITE_ONCE() are added to make sure nothing terribly wrong
can happen because of the compiler.
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dietmar.eggemann@arm.com
Cc: gaku.inami.xh@renesas.com
Cc: vincent.guittot@linaro.org
Link: http://lkml.kernel.org/r/1530699470-29808-9-git-send-email-morten.rasmussen@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4d181478c5b8..938063639793 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1697,8 +1697,8 @@ static inline void add_nr_running(struct rq *rq, unsigned count) if (prev_nr < 2 && rq->nr_running >= 2) { #ifdef CONFIG_SMP - if (!rq->rd->overload) - rq->rd->overload = 1; + if (!READ_ONCE(rq->rd->overload)) + WRITE_ONCE(rq->rd->overload, 1); #endif } |