Skip to content

Commit 667ea36

Browse files
Christoph Hellwigaxboe
authored andcommitted
loop: don't set QUEUE_FLAG_NOMERGES
QUEUE_FLAG_NOMERGES isn't really a driver interface, but a user tunable. There also isn't any good reason to set it in the loop driver. The original commit adding it (5b5e20f "block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop") claims that "It doesn't make sense to enable merge because the I/O submitted to backing file is handled page by page." which of course isn't true for multi-page bvec now, and it never has been for direct I/O, for which commit 40326d8 ("block/loop: allow request merge for directio mode") alredy disabled the nomerges flag. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 0676c43 commit 667ea36

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

drivers/block/loop.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,10 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
211211
if (lo->lo_state == Lo_bound)
212212
blk_mq_freeze_queue(lo->lo_queue);
213213
lo->use_dio = use_dio;
214-
if (use_dio) {
215-
blk_queue_flag_clear(QUEUE_FLAG_NOMERGES, lo->lo_queue);
214+
if (use_dio)
216215
lo->lo_flags |= LO_FLAGS_DIRECT_IO;
217-
} else {
218-
blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
216+
else
219217
lo->lo_flags &= ~LO_FLAGS_DIRECT_IO;
220-
}
221218
if (lo->lo_state == Lo_bound)
222219
blk_mq_unfreeze_queue(lo->lo_queue);
223220
}
@@ -2030,14 +2027,6 @@ static int loop_add(int i)
20302027
}
20312028
lo->lo_queue = lo->lo_disk->queue;
20322029

2033-
/*
2034-
* By default, we do buffer IO, so it doesn't make sense to enable
2035-
* merge because the I/O submitted to backing file is handled page by
2036-
* page. For directio mode, merge does help to dispatch bigger request
2037-
* to underlayer disk. We will enable merge once directio is enabled.
2038-
*/
2039-
blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
2040-
20412030
/*
20422031
* Disable partition scanning by default. The in-kernel partition
20432032
* scanning can be requested individually per-device during its

0 commit comments

Comments
 (0)