diff options
author | Jan Kara <jack@suse.cz> | 2020-06-05 16:58:37 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-06-17 09:07:11 -0600 |
commit | c3dbe541ef77754729de5e82be2d6e5d267c6c8c (patch) | |
tree | 6e0b3e4b26c3ccbbd9300ec69883b95d99400fcf /tools/perf/scripts/python/compaction-times.py | |
parent | 1b0b283648163dae2a214ca28ed5a99f62a77319 (diff) |
blktrace: Avoid sparse warnings when assigning q->blk_trace
Mostly for historical reasons, q->blk_trace is assigned through xchg()
and cmpxchg() atomic operations. Although this is correct, sparse
complains about this because it violates rcu annotations since commit
c780e86dd48e ("blktrace: Protect q->blk_trace with RCU") which started
to use rcu for accessing q->blk_trace. Furthermore there's no real need
for atomic operations anymore since all changes to q->blk_trace happen
under q->blk_trace_mutex and since it also makes more sense to check if
q->blk_trace is set with the mutex held earlier.
So let's just replace xchg() with rcu_replace_pointer() and cmpxchg()
with explicit check and rcu_assign_pointer(). This makes the code more
efficient and sparse happy.
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions