Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1098269ybh; Tue, 10 Mar 2020 14:41:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vujvuhL2yj9KRIPyDxCE4xw+Rv+Nb8jYeWlmCGlbGOw4mM3rweOtn8pFKBT2JnGUYQLBOh8 X-Received: by 2002:a9d:6e87:: with SMTP id a7mr18272630otr.352.1583876465759; Tue, 10 Mar 2020 14:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583876465; cv=none; d=google.com; s=arc-20160816; b=DO43h4TJ9C+1fzYsTeFppsUAyapEY1fQHvjLuOWb1+F40JXM3y5ucWrxEJZpVJqvip u30ePkPO/Hv5xiLOed0FZoS/J93+4Fe6hA6coGuBfmMVKg7EstYU9Yb41OaKntzhTnz0 mEHYtDx51V376/302Z9eTSVeQ+FmeK2vJ4Jfpgnu2nxDSDZXSOow6bP3UAXJspq+xwpP truxlBI2aTyHK5dqB88JY3nINp6ylXwvghVFdL5U/IBpxv4nQ2XxPgu6Ci+xB7jp8xQr HejMhabJi2vK3OCJIQ2eQ7YZyLSxAYZesLvGZCcCYZ+E2o/g6aYQMUqZUyT/dVrkifSa FTUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XCGcS9a2CGwye6GFDgrChkaNWdJCha/pCDhATa2Sois=; b=P94K9GdLiwRN19AZYj9CuWVj0VaWNAMmXybEHoHX8OYPSnP4GmCGGwFzpPLZFtDjUc eqgaS4KzRgBOomr/IkJK0p51WwSFjyvOWjUExEm+TWnJWlHlrsRawjt6ZpW2aEn33P/j eIixRPq/R4uHAlrjusouvleP55jreptrPpQsqmPfbs46CvRDu3kx9sBgcdKQ/tNT5oR+ rhYA/1ukhQHcOq0UP7QiQHtp+qn4Gjy73Vb94xzl+Bhlc+sdnW/bB1Dbf4lgvz8gYk49 4vMlxj/2PISE1LTCkb9chdSvaRMDMp0MGD1s3iBQvDQPaGEcRstcvzeGurqdYO30VSNP 9tSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g+kyGN2T; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si45719oih.243.2020.03.10.14.40.54; Tue, 10 Mar 2020 14:41:05 -0700 (PDT) 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=@kernel.org header.s=default header.b=g+kyGN2T; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727687AbgCJVkV (ORCPT + 99 others); Tue, 10 Mar 2020 17:40:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:37552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbgCJVkV (ORCPT ); Tue, 10 Mar 2020 17:40:21 -0400 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 296F7222C4; Tue, 10 Mar 2020 21:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583876420; bh=2+jDH4kDyuHQzpzFEB7OLFpaoFg+zPVBPm0XhdjGSIU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=g+kyGN2TSnZAY2YysV5uxYbL62/eIXhhTjzlw03MpPtCaHRYMMbMZxJep7q6XKLSJ AeWq6OoOotR/RGD4lXtx2IeMHYbvd8RqR5ziAwC2097ZRwQk4m1iY5XV0InpiQT6cZ buiEtZK9C/UCPMq8bUKa8aXvHFgmHV9Vqsubmk48= Received: by mail-lj1-f177.google.com with SMTP id g12so3667197ljj.3; Tue, 10 Mar 2020 14:40:20 -0700 (PDT) X-Gm-Message-State: ANhLgQ3e5UAKSnngdj1JoneI0aaHP/xHKlXbSyoOFUu9eOTt0Et1Ya9c 560ArSPQOEzvkn83gT2IHJ1UBB9biC03kxTLEYk= X-Received: by 2002:a05:651c:1182:: with SMTP id w2mr119990ljo.235.1583876418295; Tue, 10 Mar 2020 14:40:18 -0700 (PDT) MIME-Version: 1.0 References: <158290150891.4423.13566449569964563258.stgit@buzz> <7133c4fb-38d5-cf1f-e259-e12b50efcb32@oracle.com> In-Reply-To: <7133c4fb-38d5-cf1f-e259-e12b50efcb32@oracle.com> From: Song Liu Date: Tue, 10 Mar 2020 14:40:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices To: Bob Liu Cc: Konstantin Khlebnikov , linux-block@vger.kernel.org, Jens Axboe , open list , linux-raid , Dmitry Monakhov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 2, 2020 at 4:16 AM Bob Liu wrote: > > On 2/28/20 10:51 PM, Konstantin Khlebnikov wrote: > > 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); > > > > > > Nitpick.. (PAGE_SHIFT - 9) > Reviewed-by: Bob Liu Thanks for the fix. I fixed it based on the comments and applied it to md-next. Jens, I picked the patch to md-next because md is the only user of disk_stack_limits(). Please let me know if you prefer routing it via the block tree. Thanks, Song