From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0139AC77B6E for ; Fri, 14 Apr 2023 05:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbjDNFLf (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: io-uring@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.