Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp58591rwe; Thu, 13 Apr 2023 22:11:57 -0700 (PDT) X-Google-Smtp-Source: AKy350Yj9viJiFtBmSuWPy2wcmxecXQBh8PlnnRmke396aVJEl9VG4qrNqZMm9d6PP4QINsyG3N6 X-Received: by 2002:a17:90a:9281:b0:246:938d:db55 with SMTP id n1-20020a17090a928100b00246938ddb55mr4439231pjo.13.1681449116757; Thu, 13 Apr 2023 22:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681449116; cv=none; d=google.com; s=arc-20160816; b=ADeIqkL88Dmxs9spmJNtE/LheGZ8ZJ3gd6WV1DI2j95K7cTI4mDfuaFvnGR4DGBd8/ EfvmR1HJ3s8RK8NGUHcOfMgmvbDdsIEpWm4nC7YnP48hdI9N3AgEcG+1qcPIJlvmcE73 JTHvkMdP5lbk6YVEseDSaJM+ImJynvJHtxY/knT1J2kDSUTGzjng3nHYU2EE1I9eWNAO JBabz/YRFYH4ldPOm2HRGcGQ1BYX5tEqUrDm56xA6qu7G1WeyxKNl8ii6ozzphXMN2o0 SQnDuq6zr3PJOb6Hno5JVRcKeWEaebieE7nG2g5k4/zhhuaBNU2bJd57Ho4kzKtEcKAv A5Bw== 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=WNOpNMH/eVLZcNAlnGp7soNPe+TQ073CyBzF+5FM2Ds=; b=SQ5p2OIYWeX9dkXHuX08GZpeCQcAx+o3gymfumpKK6C2695zFTEE0PG2CLaf2pMMsf mlAFw76LKAqfqUAiBx1Fo8pELMcZ/GdPh8lg6D1gNAG369f8+P2OTnagolUm3V3U6RxJ uoTDKm/o4TBJakd2CHCNeMXWVt9vlOkExs4wx90i3XF3+BknXuVM/tAHIE1GxH0MhE1k a/PoDrqdjilizzObp78YyKo3M8F+o//wErQAiUQFriieQW+ExzE94JoDgJ53OsEccrwB LKUxGpoF9rEhXghZXo1ctB3pruBaluURS7aeOpRA7IbxIdvE4QhbpLwLkZBAwVOXCVm1 pjnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=K0qBJEdD; 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 c16-20020a17090a8d1000b002473c0c9fe9si1098273pjo.50.2023.04.13.22.11.38; Thu, 13 Apr 2023 22:11:56 -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=K0qBJEdD; 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 S229546AbjDNFLf (ORCPT + 99 others); Fri, 14 Apr 2023 01:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjDNFLc (ORCPT ); Fri, 14 Apr 2023 01:11:32 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 067D440C0; Thu, 13 Apr 2023 22:11:31 -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=WNOpNMH/eVLZcNAlnGp7soNPe+TQ073CyBzF+5FM2Ds=; b=K0qBJEdDeP8bxy0/G8rBpyKSSg xp0T/wvagY9TVPFgsUvWcAz+bmk5DHUusDpNl1DxzquVfg2R+5bV7o24jjVsT5h9JqagvZWLBK9Sp KxlO4JJOZfO8AxZrHpuNjEQaLZHjrNQvj76TnQ0gPUMFyMHP5yZthzbs2/XPlW1a0yiKgAPrak9oX fgTuEH2nmivhPfks5SoR+ZGTaD3SgXEDu+f0cjd1MbGeMCZUQo7M7vkFFpxWrUVG82sy5rsZsxOAb eg3Otbqk3VqZvHuog9uT6uGBc2ZVQB6meB5n312fEo/ivl74F2a68RcayscAlTlJLd+euMKFsTp3k 05BT889Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pnBia-008KcZ-0w; Fri, 14 Apr 2023 05:11:28 +0000 Date: Thu, 13 Apr 2023 22:11:28 -0700 From: Christoph Hellwig To: Miklos Szeredi Cc: Bernd Schubert , axboe@kernel.dk, io-uring@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, dsingh@ddn.com Subject: Re: [PATCH 1/2] fs: add FMODE_DIO_PARALLEL_WRITE flag Message-ID: References: <20230307172015.54911-2-axboe@kernel.dk> <20230412134057.381941-1-bschubert@ddn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Thu, Apr 13, 2023 at 09:40:29AM +0200, Miklos Szeredi wrote: > fuse_direct_write_iter(): > > bool exclusive_lock = > !(ff->open_flags & FOPEN_PARALLEL_DIRECT_WRITES) || > iocb->ki_flags & IOCB_APPEND || > fuse_direct_write_extending_i_size(iocb, from); > > If the write is size extending, then it will take the lock exclusive. > OTOH, I guess that it would be unusual for lots of size extending > writes to be done in parallel. > > What would be the effect of giving the FMODE_DIO_PARALLEL_WRITE hint > and then still serializing the writes? I have no idea how this flags work, but XFS also takes i_rwsem exclusively for appends, when the positions and size aren't aligned to the block size, and a few other cases.