Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp538510ybh; Thu, 12 Mar 2020 06:42:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvP6LBtZ4QZhwNh/AGmTkxJFGbDDmW92Mzlym0NU6NDjQbzhZceblikR6V7Nu7MkeIiuZhJ X-Received: by 2002:a05:6830:119:: with SMTP id i25mr5036983otp.81.1584020538536; Thu, 12 Mar 2020 06:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584020538; cv=none; d=google.com; s=arc-20160816; b=0mbWFU3rmPLapE1k50kQXYB2lbJ2wzq4Pb67Ev8iNG1/iSzl6muDEDtzDOBuxU2Sfw 27E3/sHEEJq1L8NFNcH7IjhLWugOi8a53vBmtTWP8Frdh0bWhNr5fSEICvTtDLwGS7Qw YZ/oiMV5NcbBRk4dCKOD8ap4LB2sulItQs2UMIIurkyO3E1YIJXJXlfdO4ZOsDgoSBsT P8IajzC9lBJo887T7HLOs6tyQ+d5GdKJgusWwBaCtt4QXSwGFnEPi8PT+5fnmZTREh35 b2mOUPYT+3Oo0iSgYM+Le3ET7OlvMI/HhcpSezwh1ahUup+Mp5UQK/zweXgcJqwMVMov Mt6w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=6fRFcMHQQvgXUMu9ji5eLUkSQJ3mpFpcehi61CBMmK0=; b=AOthBtljOCPbPApLLz3jVQiifPD6IRS2Kr2ybVEdnCSPrBKruGP1PVOQ1xs/PAWaYz QCGhzShn5RHxcrHgSVvdz5lHGE2G2By+JcbSghWvgzKtr6jpaHCrDPfpzpwAtusFznUb A2Nr8NfbAL+jppzYF7X8mCw3eFCXIpe/6MtpnzO6aP+lyj+MxsVddJL0SPPVTuL2BHlN qAygzNLngJHuuy2oMGbcNgrc6NscudEz9w8ElzUOburKMZLaP3fKPogDZTl6DLrZ3GyF 7uMdrLoG61jOewb1MwsbtEdBF4VDX1cRiR3vDHLWpP/CV/2UedgAq5qNXK7giLG5ylmh ubbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=q21WvNG+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si1677154oou.32.2020.03.12.06.42.05; Thu, 12 Mar 2020 06:42:18 -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-dk.20150623.gappssmtp.com header.s=20150623 header.b=q21WvNG+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbgCLNkm (ORCPT + 99 others); Thu, 12 Mar 2020 09:40:42 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:46738 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727208AbgCLNkl (ORCPT ); Thu, 12 Mar 2020 09:40:41 -0400 Received: by mail-il1-f195.google.com with SMTP id e8so5453896ilc.13 for ; Thu, 12 Mar 2020 06:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=6fRFcMHQQvgXUMu9ji5eLUkSQJ3mpFpcehi61CBMmK0=; b=q21WvNG+GvuYoEsq+TO9ASqezouRrFYukS0qs9+/FVkQ/489coT/AQ8ax1hFwqHRJU MRhWI8dBvnOqOCK8t7K4nymV9ovnw2DZ6ITSGhPcQl9cZO6PZEj2yf52T8wlLvemuVxF F/ioKw6MzcvahxTLKevhohlkvYngYaJYf8uDkmlqredqzJAnozwoBnCdnnC8RI79G1Ug LMnNNfOeiZFkQQuOGDJl1NkUIAaMwERSX0o0ZZVRxHuhsVXTFuTO/Q+s6c8Cn4boo6Ip Mk6LYop6Mw/YDwISqv03OiREVPKhgO/nwF4l77xSI5oZ+exFIKxvT+PwyJBbPdHIqVnl lUJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6fRFcMHQQvgXUMu9ji5eLUkSQJ3mpFpcehi61CBMmK0=; b=r3bStXsjCBF674E5CU33kzxBYAqK1VEyfcOlSTIQt4jwDZwquM33N+VxBWHt6ilAPg z6gVFhrprMNPQHOAsr/bAek6pvtxHX63R9qjaVwyRh9SUUOeJN3nHY+SqowhFOeF2xSV JdaLf/tKd054F4fD/OP84y42l5AVPtHNon2Iv1Anfby868njUd3Y8sZRf48pafrPMNea Z4Mu35g3vPyBsirw8L0L0Szu6pdjAVdm7Genl2BGVbr1tGWFdx/IizLWTGWdFiu9zUSi YHy6PgqT/E2aY7FaNfX3kTjQFwn7OM4Ysx8mFPVFTGzy2abdNNo08UOTHDfVzI4W5ZnK 9k/Q== X-Gm-Message-State: ANhLgQ1GuLsSkXubBhIOUfdSun0qi+j3mrX1B/kYjTnYp+YOAIHzVvdr 3KP4Rmk9QsPShLFjwrzIufbzJQ== X-Received: by 2002:a92:c851:: with SMTP id b17mr2678052ilq.194.1584020440417; Thu, 12 Mar 2020 06:40:40 -0700 (PDT) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id g88sm1381275ila.47.2020.03.12.06.40.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Mar 2020 06:40:39 -0700 (PDT) Subject: Re: [PATCH] block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices To: Song Liu , Bob Liu Cc: Konstantin Khlebnikov , linux-block@vger.kernel.org, open list , linux-raid , Dmitry Monakhov References: <158290150891.4423.13566449569964563258.stgit@buzz> <7133c4fb-38d5-cf1f-e259-e12b50efcb32@oracle.com> From: Jens Axboe Message-ID: Date: Thu, 12 Mar 2020 07:40:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/10/20 3:40 PM, Song Liu wrote: > 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. That's fine, thanks. -- Jens Axboe