diff options
author | Jan Kara <jack@suse.cz> | 2021-09-03 00:53:15 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-03 19:58:10 +0300 |
commit | 20792ebf3eeb828a692b29f3000673cb9ca83c3a (patch) | |
tree | da1d233b22e10d2824da430b27af639b0c502156 /fs/afs | |
parent | 42dd235cb15c06c8446f9aed695648a3c2eb8d11 (diff) | |
download | linux-20792ebf3eeb828a692b29f3000673cb9ca83c3a.tar.xz |
writeback: use READ_ONCE for unlocked reads of writeback stats
We do some unlocked reads of writeback statistics like
avg_write_bandwidth, dirty_ratelimit, or bw_time_stamp. Generally we are
fine with getting somewhat out-of-date values but actually getting
different values in various parts of the functions because the compiler
decided to reload value from original memory location could confuse
calculations. Use READ_ONCE for these unlocked accesses and WRITE_ONCE
for the updates to be on the safe side.
Link: https://lkml.kernel.org/r/20210713104716.22868-5-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Michael Stapelberg <stapelberg+linux@google.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs')
0 files changed, 0 insertions, 0 deletions