Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4577793pxf; Tue, 30 Mar 2021 11:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybnscNPaRXRu9nYlB3czQOTItnClwST45ya+eJqLMpJiqBCTGH4rnG+wOPZZBW+tHXyBvC X-Received: by 2002:a17:906:b286:: with SMTP id q6mr34590981ejz.422.1617127723400; Tue, 30 Mar 2021 11:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617127723; cv=none; d=google.com; s=arc-20160816; b=afW2GhFpLDpK1uTK8kpwdtBqydeaB9lDCfB1GPjtJXGXQyr4+rRZFniGyQTtrcIQBu bWM/0DCMINBarw2sOgeoPbklp2s4QyvqWSFc8fB850h3Kghhg6gpYmGac1OTqCzmdgUX bHc2a00Ujp082KkWCMVRtQuCGqchd4/14V1SUwLUK6O8wypZd8KDThm9wfxBYMUsUkTL +q74xJnITgheRanfTtNjYGYC7RuI3eWF68SGudnYRsg6wdXVLtzxfsy3sAQkJkAVgRv9 dnLRRW3CcC59tIgQNS13gj9d5WenyHLy18vsVXp3560zsB7Xt1zQ83MuDAzJ0859NiaW Cx6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ikqdyaQPieS1igk4+QfbwgRhqOQlOvMU3Hk6slv/dvs=; b=Io1c/kX24XmytRtD2DlyXvN0S1OeflqLX3cearC1Vk+TmLikTrj/C85Nlr8UaYMSGr l1gzDOlI+A+8k6UtvhcjJ4ezk4+LxtMn3FCh71Gc3YijCVJzFnzD6D7LPSxMJOMzFL7w Lmskf3AZ+xQXw6dvxF1pkSLLR9rmNLxfMnH0SiaoWATNSBmd6gZ/D6iPqYsxNoANHqt7 ZV7Ybx0W3Xr2rPQYwcZgiXALg/TCyjlqI8n4Om+j+4N+u/QynYZ5iFKc8ELcZpjuP1BT XC/hHEtsM/L/4mk0vgqzZsNYGu5ZOHtvUxraDLwJnLsTdeJciEjKT3vNgFHye1xIE0l/ q4Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ef2wi2xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo5si15244979edb.459.2021.03.30.11.08.19; Tue, 30 Mar 2021 11:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ef2wi2xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232419AbhC3SHQ (ORCPT + 99 others); Tue, 30 Mar 2021 14:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232657AbhC3SHF (ORCPT ); Tue, 30 Mar 2021 14:07:05 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7EF6C061574; Tue, 30 Mar 2021 11:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ikqdyaQPieS1igk4+QfbwgRhqOQlOvMU3Hk6slv/dvs=; b=ef2wi2xvLt0TG4RIghAyy9jVoc 0sUS3+iLBFCGTy0jwTN/+ZeLRLcVlOYM+bCLA0oviPLb/SoortrsGw94ooWezevAiGEWeSj70N4SO znDAxVDkv8t+oUx7p+OoArsKeU4sEyu8KCfiWnZtVpaM0RxhXzjiZvF1Y6P3WylQ4voL0pXA37ah0 MdWqZQH6Y2nlxbMaXpE9C4LIkwlOHgVi8nRcRdP2BiiTtZhIwLpqnfUsf0ONm9xKzv4abufX5btDl nTRWzeYnguqcPDNfIOcbZ/cEpEF7PBxe37HoMsBO4R08L/j/PMHGKPkCN14u/wP4moZxfflooo0iR 72Ieh34Q==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lRIlR-003PTG-8Z; Tue, 30 Mar 2021 18:06:56 +0000 Date: Tue, 30 Mar 2021 19:06:53 +0100 From: Christoph Hellwig To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Eric Biggers Subject: Re: [PATCH v2 4/8] block: introduce bio_required_sector_alignment() Message-ID: <20210330180653.GB811594@infradead.org> References: <20210325212609.492188-1-satyat@google.com> <20210325212609.492188-5-satyat@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210325212609.492188-5-satyat@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 09:26:05PM +0000, Satya Tangirala wrote: > +/* > + * The required sector alignment for a bio. The number of sectors in any bio > + * that's constructed/split must be aligned to this value. > + */ > +static inline unsigned int bio_required_sector_alignment(struct bio *bio) > +{ > + struct request_queue *q = bio->bi_bdev->bd_disk->queue; > + > + return max(queue_logical_block_size(q) >> SECTOR_SHIFT, > + blk_crypto_bio_sectors_alignment(bio)); > +} It might make more sense to just have a field in the request queue for the max alignment so that the fast path just looks at one field. Then the various setup time functions would update it to the maximum required.