Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp743326ybf; Fri, 28 Feb 2020 06:52:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzXGCSA4IPMsWqJCQq8ixOHZbAZnRMKFK6aNdZdE8sQJhaq3L6TU4V3UDpFQBaFEy4SqiT+ X-Received: by 2002:aca:724a:: with SMTP id p71mr3542261oic.23.1582901539544; Fri, 28 Feb 2020 06:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582901539; cv=none; d=google.com; s=arc-20160816; b=VYeaJJtFwQ/bea5kmLa8VI8xERldfHYlJ9IqCDRHDf12TRdRQ9l39WyYvDY07egAJu hp2Lo5+olzED24SZixKmGErTcKE1gs13pUuXJsam3KT3Ztw01VCZoOInPjod9huCdqtg nJbMKA5B5JfengPSKlwqp3aCGZfgUa/qmciYBetB7BOz5EVXqAvzuOV4h/F7fiNiJeTa 14lIvloFp6OkraUk7hOBNBNYFufEUKLGN1UO5pGnP18sKrFaCx0471ZzKQ3/JpkLnNvo xX0uTy8Vac9+FqLS7mOHQHUtDryUjwyp0MJgTmAs3up56LPMFukS+vnInDvL2bZgQ/GH T+uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=3CUipkMt+bSgia8WEU+rF0ciWlpyvyU/3asDSlZSq/Q=; b=Wtl+gjxrt4VHtGcNdcyYE43sjLmvWs6Ueei9BA2DMca91JTumPqpahrphadAKzuD5O SN6MIsCWd/3ov0LwrCP8X4jMVEDy6llBtm5eJXvoQPchbWmkQypF9F2p52KOwM3o1qg3 cglYmym6RNf/llTUV/d9nsXS+s9Tu3y1J13SDJHqZ04qYA8Gi9OYmqmhiTEyVJ08zny+ zwyqXoCa6LR+UNNzaWts3vvIphdKTAwmI2UbbJKAis4JnXB122yDbK2ZdOo4zXH0e5+L Z7C0J7iYeDb0ZEAIVlj95plVs7aHpXbtxXT8bZHexjpYCqFIvD5ErMK/eHuIXqL7u1oG IUIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=CIwTFRGL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si119563otr.108.2020.02.28.06.52.06; Fri, 28 Feb 2020 06:52:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=CIwTFRGL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727011AbgB1Ovx (ORCPT + 99 others); Fri, 28 Feb 2020 09:51:53 -0500 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]:47400 "EHLO forwardcorp1o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbgB1Ovw (ORCPT ); Fri, 28 Feb 2020 09:51:52 -0500 Received: from mxbackcorp1j.mail.yandex.net (mxbackcorp1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::162]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id DDA3D2E236D; Fri, 28 Feb 2020 17:51:49 +0300 (MSK) Received: from myt4-18a966dbd9be.qloud-c.yandex.net (myt4-18a966dbd9be.qloud-c.yandex.net [2a02:6b8:c00:12ad:0:640:18a9:66db]) by mxbackcorp1j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id FxdxNCnZlJ-pnO4jPlF; Fri, 28 Feb 2020 17:51:49 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1582901509; bh=3CUipkMt+bSgia8WEU+rF0ciWlpyvyU/3asDSlZSq/Q=; h=Message-ID:Date:To:From:Subject:Cc; b=CIwTFRGLQ/zJ6YWYfz9ON1HCMbQcSRVtiNhvqAutNEWUZM/A9BGhy9QULOCiO0vp0 4J3ED55V7lOwBB212nXyPghP04JkM4/2coc4s7OnlrvKKql91azLL+NTX8JS34MHm1 uQPT97lTK+qUsxY1MSvGziYnfgkBn8afE2zs7vKA= Authentication-Results: mxbackcorp1j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:8448:fbcc:1dac:c863]) by myt4-18a966dbd9be.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 9otU8atEIs-pnWqkOl7; Fri, 28 Feb 2020 17:51:49 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: [PATCH] block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices From: Konstantin Khlebnikov To: linux-block@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-raid@vger.kernel.org, Song Liu , Dmitry Monakhov Date: Fri, 28 Feb 2020 17:51:48 +0300 Message-ID: <158290150891.4423.13566449569964563258.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Field bdi->io_pages added in commit 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests. Stacked drivers do not call blk_queue_max_hw_sectors(). Instead they setup limits of their devices by blk_set_stacking_limits() + disk_stack_limits(). Field bio->io_pages stays zero until user set max_sectors_kb via sysfs. This patch updates io_pages after merging limits in disk_stack_limits(). Commit c6d6e9b0f6b4 ("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs. Signed-off-by: Konstantin Khlebnikov --- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index c8eda2e7b91e..66c45fd79545 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n", top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT-9); } EXPORT_SYMBOL(disk_stack_limits);