Bypass if: bio->bi_opf & (REQ_RAHEAD|REQ_THROTTLED) Writeback if: bio->bi_opf & (REQ_SYNC|REQ_META|REQ_PRIO|REQ_NOIDLE|REQ_FUA|REQ_PREFLUSH) Signed-off-by: Eric Wheeler <bcache@xxxxxxxxxxxxxxxxxx> --- drivers/md/bcache/request.c | 3 +++ drivers/md/bcache/writeback.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 52e646f..ff356d7 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -388,6 +388,9 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) op_is_write(bio_op(bio)))) goto skip; + if (bio->bi_opf & (REQ_RAHEAD|REQ_THROTTLED)) + goto skip; + /* If the ioprio already exists on the bio, use that. We assume that * the upper layer properly assigned the calling process's ioprio to * the bio being passed to bcache. Otherwise, use current's ioc. */ diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h index 176b1b3..359361c 100644 --- a/drivers/md/bcache/writeback.h +++ b/drivers/md/bcache/writeback.h @@ -81,7 +81,7 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio, return true; } - return bio->bi_opf & REQ_SYNC || + return bio->bi_opf & (REQ_SYNC|REQ_META|REQ_PRIO|REQ_NOIDLE|REQ_FUA|REQ_PREFLUSH) || in_use <= CUTOFF_WRITEBACK; } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html