From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B0DDC2BB85 for ; Fri, 10 Apr 2020 03:53:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD87F20CC7 for ; Fri, 10 Apr 2020 03:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586490801; bh=7Wrp0PSfQ8AxYH33MglpUgdu3eVad235QHlg9qT66K0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IHe/cvB3bHBd5ZQ52mtgHysLqtnj9wXiUCdCdmcWQoMvcqTZRAqVTg639up8p9wIk c/LoVnCBD+g+jahqemSxoYPYr8T6WOYIArgnvIHbI8MUT2B00vKqQ/HJrNgOvRWHsZ Y1bTNDKGRZiLuvHhzgpMGyV8R8U9sqpVLAM3WOYI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728998AbgDJDuw (ORCPT ); Thu, 9 Apr 2020 23:50:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728311AbgDJDuv (ORCPT ); Thu, 9 Apr 2020 23:50:51 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B6DD20B1F; Fri, 10 Apr 2020 03:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586490651; bh=7Wrp0PSfQ8AxYH33MglpUgdu3eVad235QHlg9qT66K0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uehDIw9SmERhey9olpbKPQS6ap9JXMKkvO/cOwWXPUdcuaru1Zw1FJv1aniesKYbT yRroMoeaihPzvEUMlPOorSZXfZoMj0yVRR+e5dCACw1MF4a0ngxjR/bllvMAZg7N6Y hd4MRySlkclzD1x0HoV0jC8cSA3WlYe6DYwfoUzE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konstantin Khlebnikov , Paul Menzel , Bob Liu , Song Liu , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 05/22] block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices Date: Thu, 9 Apr 2020 23:50:27 -0400 Message-Id: <20200410035044.9698-5-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200410035044.9698-1-sashal@kernel.org> References: <20200410035044.9698-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Konstantin Khlebnikov [ Upstream commit e74d93e96d721c4297f2a900ad0191890d2fc2b0 ] 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 set 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. Fixes: 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting") Reviewed-by: Paul Menzel Reviewed-by: Bob Liu Signed-off-by: Konstantin Khlebnikov Signed-off-by: Song Liu Signed-off-by: Sasha Levin --- block/blk-settings.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index 6c2faaa38cc1e..e0a744921ed3d 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -717,6 +717,9 @@ 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); -- 2.20.1