diff options
author | Matt Fleming <matt@codeblueprint.co.uk> | 2017-02-17 12:07:31 +0000 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-03-16 09:21:01 +0100 |
commit | caeb5882979bc6f3c8766fcf59c6269b38f521bc (patch) | |
tree | ee5e0c30b3ecfd99651f74ffd1403db8ac530280 /drivers | |
parent | 6e5f32f7a43f45ee55c401c0b9585eb01f9629a8 (diff) | |
download | linux-caeb5882979bc6f3c8766fcf59c6269b38f521bc.tar.bz2 |
sched/loadavg: Use {READ,WRITE}_ONCE() for sample window
'calc_load_update' is accessed without any kind of locking and there's
a clear assumption in the code that only a single value is read or
written.
Make this explicit by using READ_ONCE() and WRITE_ONCE(), and avoid
unintentionally seeing multiple values, or having the load/stores
split.
Technically the loads in calc_global_*() don't require this since
those are the only functions that update 'calc_load_update', but I've
added the READ_ONCE() for consistency.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: http://lkml.kernel.org/r/20170217120731.11868-3-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions