block/loop: set hw_sectors

Loop can handle any size of request. Limiting it to 255 sectors just
burns the CPU for bio split and request merge for underlayer disk and
also cause bad fs block allocation in directio mode.

Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Shaohua Li 2017-08-31 22:09:45 -07:00 committed by Jens Axboe
parent 2670cd1674
commit 54bb0ade66
1 changed files with 1 additions and 0 deletions

View File

@ -1736,6 +1736,7 @@ static int loop_add(struct loop_device **l, int i)
blk_queue_physical_block_size(lo->lo_queue, PAGE_SIZE); blk_queue_physical_block_size(lo->lo_queue, PAGE_SIZE);
blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
/* /*
* It doesn't make sense to enable merge because the I/O * It doesn't make sense to enable merge because the I/O
* submitted to backing file is handled page by page. * submitted to backing file is handled page by page.