diff options
author | Tang Junhui <tang.junhui@zte.com.cn> | 2017-09-06 02:25:52 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-09-06 10:17:33 -0400 |
commit | c81ffa32a214c84b08900fbc9d432187bd948eba (patch) | |
tree | ab00291fe74fbaa552bc3cd7a679492ac74430bc /drivers/md/bcache/request.c | |
parent | 4b758df21ee7081ab41448d21d60367efaa625b3 (diff) |
bcache: fix sequential large write IO bypass
Sequential write IOs were tested with bs=1M by FIO in writeback cache
mode, these IOs were expected to be bypassed, but actually they did not.
We debug the code, and find in check_should_bypass():
if (!congested &&
mode == CACHE_MODE_WRITEBACK &&
op_is_write(bio_op(bio)) &&
(bio->bi_opf & REQ_SYNC))
goto rescale
that means, If in writeback mode, a write IO with REQ_SYNC flag will not
be bypassed though it is a sequential large IO, It's not a correct thing
to do actually, so this patch remove these codes.
Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 0e1463d0c334..de97d86ddff4 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -400,12 +400,6 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) | |||
400 | if (!congested && !dc->sequential_cutoff) | 400 | if (!congested && !dc->sequential_cutoff) |
401 | goto rescale; | 401 | goto rescale; |
402 | 402 | ||
403 | if (!congested && | ||
404 | mode == CACHE_MODE_WRITEBACK && | ||
405 | op_is_write(bio->bi_opf) && | ||
406 | op_is_sync(bio->bi_opf)) | ||
407 | goto rescale; | ||
408 | |||
409 | spin_lock(&dc->io_lock); | 403 | spin_lock(&dc->io_lock); |
410 | 404 | ||
411 | hlist_for_each_entry(i, iohash(dc, bio->bi_iter.bi_sector), hash) | 405 | hlist_for_each_entry(i, iohash(dc, bio->bi_iter.bi_sector), hash) |