Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2061547rwl; Thu, 13 Apr 2023 00:45:49 -0700 (PDT) X-Google-Smtp-Source: AKy350av+BDCrahH6sWd22e2ytwk1b5fBOfRpzwt2JZvFnD3w62UgjiMoaBHu3k/hJStPQpNltk/ X-Received: by 2002:aa7:c155:0:b0:501:d43e:d1dd with SMTP id r21-20020aa7c155000000b00501d43ed1ddmr1250582edp.33.1681371948753; Thu, 13 Apr 2023 00:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681371948; cv=none; d=google.com; s=arc-20160816; b=xKOBi9LbnSdrPg+zXWhjS2ketV1p+SEHnOrBP04/cjvHjg1kdD5cCgcVCuqBT2P3Tv 5ydiEsp5PuSItDBlggu4vC0a01zNUVAZ9Mj+Jrvl9/aditDZbZcnAO2MKxVVVwqKUtQN oTgWUAt9RlqUg3bDJItmI5UQTUrVrKrJPsxXtrTccHQwy4Pd642a912sMnNssfwxaMV9 y+hTjpAdSNoE+hJTze1K3+vIG4q0Bs6468IMLX9av/T/AoG7GCTZfPW+TJncorYAYpAm F7CQRCXEblJ2TXMJK4DIDNsAAmugPD92xpGUU5AbTYwOZ1O18zt7OwKu+ShyIQbfOYD7 zPuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7T7q7sdsDEBhtepgNI0ki2glnFFLKVYBB69jyV022y8=; b=iVQAw0LitahMP5g9puoas92BOjerH5jwonL3HcDT/PS3ozxABdwMf9r2zLZWwnfMBu JMbxcACNWLHZRkE68dB7BuWm/XvZv4bFlZWYWv04n/h73G/KmiuOXTCclf4IJ4vCsscj 8TfnUjiadwudB7NvnK3H42WXTEqkVJudexkHMmyCDsGE0lUqfMeZH9d69zilWd63P/Ak AnsMetn3VpiZB839lTbGHkkuleD21P0zxrDLrSBLFQNQEo6MBI88NzF3vsAGjMJBHX3t wX3AdxgIAP7ERc7jQbhQMuLdO0XtPlqR4iEx9R5c3Hssxo1dF8hZ3Vj2dt3ECY5xabV9 7Hpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=hmUSCKdc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ff18-20020a1709069c1200b0094a56fcab58si1209783ejc.771.2023.04.13.00.45.17; Thu, 13 Apr 2023 00:45:48 -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=@szeredi.hu header.s=google header.b=hmUSCKdc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjDMHk4 (ORCPT + 99 others); Thu, 13 Apr 2023 03:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbjDMHkz (ORCPT ); Thu, 13 Apr 2023 03:40:55 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E06283FF for ; Thu, 13 Apr 2023 00:40:42 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id sg7so46527810ejc.9 for ; Thu, 13 Apr 2023 00:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1681371641; x=1683963641; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7T7q7sdsDEBhtepgNI0ki2glnFFLKVYBB69jyV022y8=; b=hmUSCKdcDl1A1sQPr36Fu1rWnStt7OexlljdywUqMv67o/3lbAXoDlgMwsngJjYhXN wfa84/hZ1KS4bBbPZCOAXgCkflTyq1WmKILRcSAT7vdqML+gG9mhRLEbF1CBTqI8xxTj Row8yT/PAoDa/BEjOFGQQXwGxx2pLCgJkRA18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681371641; x=1683963641; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7T7q7sdsDEBhtepgNI0ki2glnFFLKVYBB69jyV022y8=; b=cEkeuj8+fsYG7yd3bQMWzwZ1jYZ1WZkSojoRJYXzLExz1NeqEcyc2FY0aJQWA4avrT Bcd+MJDsQdfRxSydtIKp+tvogKwmaKvjTTFGaygDc6HhXXED/MXJt457N0eSdq4HBSF3 zSIv+/7gk2jLioNuJtdt2+4BpSGtOJDbuLEh6WC1c0NtVQ0QmsyN86i3sSlHnGlQeNMk gEnRl1K9b3dh52L3OsC19fVShjCtex6HKYsdf/PKXWBDJNK2feC9eZRjahDLhFhpCGDZ FplMGT35hZ2whRDnGfX7pKKvuMrRmlCHaPyuIC819gmYTDvQkBChslXyrZlqqzJ7hdwy DAoQ== X-Gm-Message-State: AAQBX9c1pgeN+Mtv393ikYWV9XSLqv5tGVs/CN+ITOzX/RBSNJ9eVDVC iodl/i8fKVNWpSu9IX95o58jP4rySfbAiu6Y2J2NHw== X-Received: by 2002:a17:906:d20a:b0:94e:1014:3114 with SMTP id w10-20020a170906d20a00b0094e10143114mr752608ejz.14.1681371641053; Thu, 13 Apr 2023 00:40:41 -0700 (PDT) MIME-Version: 1.0 References: <20230307172015.54911-2-axboe@kernel.dk> <20230412134057.381941-1-bschubert@ddn.com> In-Reply-To: <20230412134057.381941-1-bschubert@ddn.com> From: Miklos Szeredi Date: Thu, 13 Apr 2023 09:40:29 +0200 Message-ID: Subject: Re: [PATCH 1/2] fs: add FMODE_DIO_PARALLEL_WRITE flag To: Bernd Schubert Cc: 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 Content-Type: text/plain; charset="UTF-8" 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_PASS,URIBL_BLOCKED autolearn=unavailable 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 Wed, 12 Apr 2023 at 15:42, Bernd Schubert wrote: > > Miklos, Jens, > > could we please also set this flag for fuse? > > > Thanks, > Bernd > > > fuse: Set FMODE_DIO_PARALLEL_WRITE flag > > From: Bernd Schubert > > Fuse can also do parallel DIO writes, if userspace has enabled it. > > Signed-off-by: Bernd Schubert > --- > fs/fuse/file.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/fuse/file.c b/fs/fuse/file.c > index 875314ee6f59..46e7f1196fd1 100644 > --- a/fs/fuse/file.c > +++ b/fs/fuse/file.c > @@ -215,6 +215,9 @@ void fuse_finish_open(struct inode *inode, struct file *file) > } > if ((file->f_mode & FMODE_WRITE) && fc->writeback_cache) > fuse_link_write_file(file); > + > + if (ff->open_flags & FOPEN_PARALLEL_DIRECT_WRITES) > + file->f_mode |= FMODE_DIO_PARALLEL_WRITE; 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? Thanks, Miklos