Skip to content

Commit

Permalink
block/loop: set hw_sectors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Sep 1, 2017
1 parent 2670cd1 commit 54bb0ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
/*
* It doesn't make sense to enable merge because the I/O
* submitted to backing file is handled page by page.
Expand Down

0 comments on commit 54bb0ad

Please sign in to comment.