summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.ne>2015-10-30 05:25:59 +0900
committerJens Axboe <axboe@fb.com>2015-10-30 05:25:59 +0900
commitcdea01b2bf98affb7e9c44530108a4a28535eee8 (patch)
treed76f70baf592052d4dff44e45bcde1ee29062570 /block
parentcfd0c552a8272d691691f40073654d775836e23a (diff)
downloadtalos-op-linux-cdea01b2bf98affb7e9c44530108a4a28535eee8.tar.gz
talos-op-linux-cdea01b2bf98affb7e9c44530108a4a28535eee8.zip
blktrace: re-write setting q->blk_trace
This is really about simplifying the double xchg patterns into a single cmpxchg, with the same logic. Other than the immediate cleanup, there are some subtleties this change deals with: (i) While the load of the old bt is fully ordered wrt everything, ie: old_bt = xchg(&q->blk_trace, bt); [barrier] if (old_bt) (void) xchg(&q->blk_trace, old_bt); [barrier] blk_trace could still be changed between the xchg and the old_bt load. Note that this description is merely theoretical and afaict very small, but doing everything in a single context with cmpxchg closes this potential race. (ii) Ordering guarantees are obviously kept with cmpxchg. (iii) Gets rid of the hacky-by-nature (void)xchg pattern. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> eviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud