Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1531553rwr; Fri, 5 May 2023 16:02:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76g7VGKUzI51Wa1KzzotL0IbVU7OvEjPJi1/UB2rUFsSVkoFtsMHHfzeP033+XGZrurm6S X-Received: by 2002:a17:90a:6089:b0:247:2680:2ad with SMTP id z9-20020a17090a608900b00247268002admr3124889pji.33.1683327733764; Fri, 05 May 2023 16:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683327733; cv=none; d=google.com; s=arc-20160816; b=GmVzHoNlrVpIzos2OK/L5cdud+1n8lY2Lp9fztjDu4uFxn9iqrdpdAz+PBYXDDpOrQ VZJVZwa+8A/57/jx0zkLO5oqSjNUMLB/iPU0klU+j2zy24tdAoLBwJZKyexkwb09nBi/ Bs1UYQ34lciGp3QAosm4ehpL559d54hVMqb2aZlB+iHSeWiBMheLqE+9A5fkv2RecAMt uaZgM63CAjqFIwVzVqwStAZW4iwIBs8IiyC8Kq1xa1RZCepcZNXJX+zGUaMqx3o4u8A1 QC8ce4cTriwK7ned4IHPkvTyNaNZ8y7cyOJjOICD3Ht9TVPh7nLJSNcmLbw/7yx2yNlm q7uA== 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=k8kxNlUbJOR09VOZkWdp3ubEF7gqx7bFnJhBwgj1yPU=; b=DYbMEzAueU5mOWDdAz3WfJRBWIUe6+WHAHQwf0ge8UT9J7yoNcBHKdx5latIBTzNTy D4BExBfKb4FfK9+3WAMpF4+Z9waBdz9u1ExdP6uxuJJfjFZhfjaYNFfmGQzmZcUn2lYp 3NbNuzYFIM0JZppWG6FO+fHUv9CJ50zjebXzczSopBA+JsS+c4e4pJimh+uRgOS16k4w ghtmfeyY9nSA2JrYR5lPTUVnv6aucMR2av1yBC/6kRoG/WFBxHtRC558RZ8qVTWJbv6d lyxxlmqIKPEO5Uzjn4Z/MHxLy/wF6CNBJSHbKk1C5DdleFJktaKomKdEYGqqEdbgNwBh hjbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DYLwKlKd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a170902c20300b001a6a3954e0fsi2760552pll.18.2023.05.05.16.02.01; Fri, 05 May 2023 16:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DYLwKlKd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232799AbjEEWrY (ORCPT + 99 others); Fri, 5 May 2023 18:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjEEWrX (ORCPT ); Fri, 5 May 2023 18:47:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79FF74EC0; Fri, 5 May 2023 15:47:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F19136412D; Fri, 5 May 2023 22:47:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE4B0C433D2; Fri, 5 May 2023 22:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683326841; bh=D0qbriAJbRPAwi0B8rnE/70zyZxx/MoRWZ/NxcKY3o4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DYLwKlKdOz6DTtddRRpzE/g5GUU5YeP9nw5j3gbN5Oz8o/mRC/Tq3TL4r8inm1/5v zCQxxwI42ekZKTzyB4UpzNeEHV8K12BxmOw3f/930wcqHv3deUCbnP/y6LoW3L0xzX tw4sbrAehxrxSzE3UA9ERBQjlnAQMcJcQ0ueaneOY4ffcP/7P8CORy9MiNBmPtCKiT QVlfg70i8qpYpGRLOP1VuVwqBo4hFm+BKzhtU/KyHNOcWRSUUR8Z5lmZs2GavGCrBR NCH4Ig18O2PysnslWZU0MjaS8vFR6Rlwh85P1WfQXTluAmwcLcbicIbNC4DMbbVoui YQltmUUIC6f6A== Date: Fri, 5 May 2023 22:47:19 +0000 From: Eric Biggers To: Dave Chinner Cc: John Garry , axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jejb@linux.ibm.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, Himanshu Madhani Subject: Re: [PATCH RFC 01/16] block: Add atomic write operations to request_queue limits Message-ID: References: <20230503183821.1473305-1-john.g.garry@oracle.com> <20230503183821.1473305-2-john.g.garry@oracle.com> <20230503213925.GD3223426@dread.disaster.area> <20230504222623.GI3223426@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504222623.GI3223426@dread.disaster.area> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 05, 2023 at 08:26:23AM +1000, Dave Chinner wrote: > > ok, we can do that but would also then make statx field 64b. I'm fine with > > that if it is wise to do so - I don't don't want to wastefully use up an > > extra 2 x 32b in struct statx. > > Why do we need specific varibles for DIO atomic write alignment > limits? We already have direct IO alignment and size constraints in statx(), > so why wouldn't we just reuse those variables when the user requests > atomic limits for DIO? > > i.e. if STATX_DIOALIGN is set, we return normal DIO alignment > constraints. If STATX_DIOALIGN_ATOMIC is set, we return the atomic > DIO alignment requirements in those variables..... > > Yes, we probably need the dio max size to be added to statx for > this. Historically speaking, I wanted statx to support this in the > first place because that's what we were already giving userspace > with XFS_IOC_DIOINFO and we already knew that atomic IO when it came > along would require a bound maximum IO size much smaller than normal > DIO limits. i.e.: > > struct dioattr { > __u32 d_mem; /* data buffer memory alignment */ > __u32 d_miniosz; /* min xfer size */ > __u32 d_maxiosz; /* max xfer size */ > }; > > where d_miniosz defined the alignment and size constraints for DIOs. > > If we simply document that STATX_DIOALIGN_ATOMIC returns minimum > (unit) atomic IO size and alignment in statx->dio_offset_align (as > per STATX_DIOALIGN) and the maximum atomic IO size in > statx->dio_max_iosize, then we don't burn up anywhere near as much > space in the statx structure.... I don't think that's how statx() is meant to work. The request mask is a bitmask, and the user can request an arbitrary combination of different items. For example, the user could request both STATX_DIOALIGN and STATX_WRITE_ATOMIC at the same time. That doesn't work if different items share the same fields. - Eric