Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1895267iog; Sun, 26 Jun 2022 00:45:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCcu4q60ruKjR1YL6de3tVc7xI2awlHG3xvlp3TwGiy2xQ8nS7aLuGzX5O11z8wgyNvmVj X-Received: by 2002:a17:907:58e:b0:726:9e67:e7cc with SMTP id vw14-20020a170907058e00b007269e67e7ccmr751103ejb.740.1656229507827; Sun, 26 Jun 2022 00:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656229507; cv=none; d=google.com; s=arc-20160816; b=rgXmKaR3imjibzbsOwKzhTZdJOQL7dlo/Pkny4Od7V79JXnFpGI8l2Pmv+PyOtNvNK KU9c4ks9rAR58GSu0m9IM2a7Q/wP5zrFBXxQQXW40wNznoooCJMYu2Vx0PgdZ4iUPDDW A9k4Gll1wHTSU39AIPofNRffx0rRqZfxqg2U2JHls6nE6VgLbxs302TkEln8FGeHzDca CQpySas9+uSB4TWYb5FTasaKEtyxF0eq8GckU6KbAiurXNX+Br5wUJYeyWo3iCCW3gbu hX10jRdaSNFGR5dhpxjkH/50vOmgeNl5WkO/qcyO59j9t9kKVLscUT0LlUb8rMPzFhFW L5iw== 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=ZYf9S+9v8SssB2f7SI0aLipRvyLjpdyjZAR4xNwIlyA=; b=W+qC3Jq2DoUXJlUMMrQsFCuAEFfWgxNRpnnjpS5SsEhM5IQ/zKpMfDlh48FLqbbjF1 yx3GUPQLRitnjWknxDMw7pYAE/GJGU1JFG1JcTIgycZyavXemWV2V1SnquRDAV/YnTF4 zmwnphDJjySrk/GPgOpUKq/N2OcpexToiYzHGQmRYSm4j7UI7CUfFnaIOXCbR6gSmHFS /JNgHwN2OpeqV9o2qYkgYrtw0M8aMQOMg/TduBsxXKwv8F+pOkLkXKG/1lUmpTdkgQ0l 1sZni6xMy2HNFK5bRReJUGQxbAhteYD/6MitcWh/9gOE/uBpZmq47oH1cFOk86n0Ury3 tYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ku+r4DqZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a50d614000000b004358c45856fsi8287147edi.412.2022.06.26.00.44.30; Sun, 26 Jun 2022 00:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@infradead.org header.s=bombadil.20210309 header.b=ku+r4DqZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbiFZHo0 (ORCPT + 99 others); Sun, 26 Jun 2022 03:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232160AbiFZHoZ (ORCPT ); Sun, 26 Jun 2022 03:44:25 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ACE311A2D; Sun, 26 Jun 2022 00:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=ZYf9S+9v8SssB2f7SI0aLipRvyLjpdyjZAR4xNwIlyA=; b=ku+r4DqZkB95/Xfmh9ue6cm+09 CyOJKQrOsW5u38sU/yT0ordtzA+/36HzICae4wQDfFz2S+Hbn5laa+W58cHSq5nsw9ipLZBhM3hNJ mXF+/5KDpW3EpisCVvR/XT04v0kdwEIr/NbG8Gznzxnrgcre+KeUy/4U2wO3EW4cPCpzcGr7sZHu4 G5qwtDrH1THEWNH3Y/cvkvBxQihfsVriRfNB5vflSLMXblFCTZcFF8+Yvxqhcd26i6lzK4QaFpaDi Bn+3NT5N/eBtb5v+o6f9b2xcqVfF+oWNL2sc+ddYWmhqUodeV8wXtxU1nuUXbY0dI+3z1TddPdJIk AQTuUgeQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5MwN-00ARUE-Bk; Sun, 26 Jun 2022 07:44:19 +0000 Date: Sun, 26 Jun 2022 00:44:19 -0700 From: Christoph Hellwig To: Avi Kivity Cc: Eric Biggers , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-api@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Keith Busch Subject: Re: [PATCH v3 1/8] statx: add direct I/O alignment information Message-ID: References: <20220616201506.124209-1-ebiggers@kernel.org> <20220616201506.124209-2-ebiggers@kernel.org> <6c06b2d4-2d96-c4a6-7aca-5147a91e7cf2@scylladb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c06b2d4-2d96-c4a6-7aca-5147a91e7cf2@scylladb.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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-ext4@vger.kernel.org On Sun, Jun 19, 2022 at 02:30:47PM +0300, Avi Kivity wrote: > > * stx_dio_offset_align: the alignment (in bytes) required for file > > offsets and I/O segment lengths for DIO, or 0 if DIO is not supported > > on the file. This will only be nonzero if stx_dio_mem_align is > > nonzero, and vice versa. > > > If you consider AIO, this is actually three alignments: > > 1. offset alignment for reads (sector size in XFS) > > 2. offset alignment for overwrites (sector size in XFS since ed1128c2d0c87e, > block size earlier) > > 3. offset alignment for appending writes (block size) > > > This is critical for linux-aio since violation of these alignments will > stall the io_submit system call. Perhaps io_uring handles it better by > bouncing to a workqueue, but there is a significant performance and latency > penalty for that. I think you are mixing things up here. We actually have two limits that matter: a) the hard limit, which if violated will return an error. This has been sector size for all common file systems for years, but can be bigger than that with fscrypt in the game (which triggered this series) b) an optimal write size, which can be done asynchronous and without exclusive locking. This is what your cases 2) and 3) above refer to. Exposting this additional optimal performance size might be a good idea in addition to what is proposed here, even if matters a little less with io_uring. But I'm not sure I'd additional split it into append vs overwrite vs hole filling but just round up to the maximum of those.