Commit 41f2df62894bfcd3bf868af916b32b90aa7168dc
Committed by
Jens Axboe
1 parent
01b6b67eda
Exists in
master
and in
4 other branches
block: BARRIER request should imply SYNC
A barrier request should by defintion have priority in get_request and let the queue be unplugged immediately as it's blocking all forward progress due to the queue draining. Most filesystems already get this implicitly by the way how submit_bh treats the buffer_ordered flag, and gfs2 sets it explicitly. But btrfs and XFS are still forgetting to set the flag, as is blkdev_issue_flush and some places in DM/MD. For XFS on metadata heavy workloads this gives a consistent speedup in the 2-3% range. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff
fs/gfs2/log.c
... | ... | @@ -595,7 +595,7 @@ |
595 | 595 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) |
596 | 596 | goto skip_barrier; |
597 | 597 | get_bh(bh); |
598 | - submit_bh(WRITE_SYNC | (1 << BIO_RW_BARRIER) | (1 << BIO_RW_META), bh); | |
598 | + submit_bh(WRITE_BARRIER | (1 << BIO_RW_META), bh); | |
599 | 599 | wait_on_buffer(bh); |
600 | 600 | if (buffer_eopnotsupp(bh)) { |
601 | 601 | clear_buffer_eopnotsupp(bh); |
include/linux/fs.h
... | ... | @@ -136,7 +136,7 @@ |
136 | 136 | * SWRITE_SYNC |
137 | 137 | * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer. |
138 | 138 | * See SWRITE. |
139 | - * WRITE_BARRIER Like WRITE, but tells the block layer that all | |
139 | + * WRITE_BARRIER Like WRITE_SYNC, but tells the block layer that all | |
140 | 140 | * previously submitted writes must be safely on storage |
141 | 141 | * before this one is started. Also guarantees that when |
142 | 142 | * this write is complete, it itself is also safely on |
... | ... | @@ -159,7 +159,7 @@ |
159 | 159 | #define SWRITE_SYNC_PLUG \ |
160 | 160 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
161 | 161 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
162 | -#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) | |
162 | +#define WRITE_BARRIER (WRITE_SYNC | (1 << BIO_RW_BARRIER)) | |
163 | 163 | |
164 | 164 | /* |
165 | 165 | * These aren't really reads or writes, they pass down information about |