Blob Blame History Raw
From: Shaohua Li <shli@fb.com>
Date: Thu, 31 Aug 2017 22:09:45 -0700
Subject: [PATCH] block/loop: set hw_sectors
Git-commit: 54bb0ade6627a183c211345761ec46e4bf0048fe
Patch-mainline: v4.14-rc1
References: bsc#1104967,FATE#325924

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>
Acked-by: Hannes Reinecke <hare@suse.com>
---
 drivers/block/loop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index f6c204f62b1e..9eff4d3ab1f3 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -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.
-- 
2.16.4