From: Shaohua Li Date: Fri, 1 Sep 2017 05:09:45 +0000 (-0700) Subject: BACKPORT: block/loop: set hw_sectors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3cd37a7c5981fe32eee0727e2c6ddd0755ccb73;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git BACKPORT: 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. Bug: 117823094 Change-Id: Ic4957181433c5a0d15f4cfdbf69dc5558d6dc5bd Reviewed-by: Omar Sandoval Reviewed-by: Ming Lei Signed-off-by: Shaohua Li Signed-off-by: Jens Axboe (cherry picked from commit 54bb0ade6627a183c211345761ec46e4bf0048fe) Signed-off-by: Martijn Coenen --- diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 81cdad14df79..369ca34f46d7 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1800,6 +1800,7 @@ static int loop_add(struct loop_device **l, int i) } lo->lo_queue->queuedata = lo; + 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.