All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schubert <bschubert@ddn.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	Dharmendra Singh <dsingh@ddn.com>
Subject: Re: [PATCH 1/2] fs: add FMODE_DIO_PARALLEL_WRITE flag
Date: Thu, 13 Apr 2023 09:25:54 +0000	[thread overview]
Message-ID: <ed4ab2bb-4e77-cf31-a035-741efc12d544@ddn.com> (raw)
In-Reply-To: <CAJfpegt_ZCVodOhQCzF9OqKnCr65mKax0Gu4OTN8M51zP+8TcA@mail.gmail.com>

On 4/13/23 09:40, Miklos Szeredi wrote:
> On Wed, 12 Apr 2023 at 15:42, Bernd Schubert <bschubert@ddn.com> wrote:
>>
>> Miklos, Jens,
>>
>> could we please also set this flag for fuse?
>>
>>
>> Thanks,
>> Bernd
>>
>>
>> fuse: Set FMODE_DIO_PARALLEL_WRITE flag
>>
>> From: Bernd Schubert <bschubert@ddn.com>
>>
>> Fuse can also do parallel DIO writes, if userspace has enabled it.
>>
>> Signed-off-by: Bernd Schubert <bschubert@ddn.com>
>> ---
>>   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?

It used here

https://lore.kernel.org/io-uring/20230403-wound-roundworm-c1660e059b8c@brauner/T/#m5f86985d6c67dd1d01a977475dab542c338372dd


fuse_finish_open has its own lock, so letting uring handle requests in 
parallel should not hurt? Is this going like

application -> uring does parallel requests -> fuse.ko -> fuse-deamon

So when fuse-deamon signals that it can handle parallel DIO, it is just 
fuse.ko that might need its own lock to extend the file?


Thanks,
Bernd

  reply	other threads:[~2023-04-13  9:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 17:20 [PATCHSET for-next 0/2] Flag file systems as supporting parallel dio writes Jens Axboe
2023-03-07 17:20 ` [PATCH 1/2] fs: add FMODE_DIO_PARALLEL_WRITE flag Jens Axboe
2023-04-12 13:40   ` Bernd Schubert
2023-04-12 13:43     ` Bernd Schubert
2023-04-13  7:40     ` Miklos Szeredi
2023-04-13  9:25       ` Bernd Schubert [this message]
2023-04-14  5:11       ` Christoph Hellwig
2023-04-14 15:36         ` Darrick J. Wong
2023-04-15 13:15           ` Jens Axboe
2023-04-18 12:42             ` Miklos Szeredi
2023-04-18 12:55               ` Bernd Schubert
2023-04-18 22:13                 ` Dave Chinner
2023-04-19  1:28                   ` Jens Axboe
2023-04-16  5:54           ` Christoph Hellwig
2023-04-19  1:29             ` Jens Axboe
2023-03-07 17:20 ` [PATCH 2/2] io_uring: avoid hashing O_DIRECT writes if the filesystem doesn't need it Jens Axboe
2023-03-15 17:40 ` [PATCHSET for-next 0/2] Flag file systems as supporting parallel dio writes Jens Axboe
2023-03-16  4:29   ` Darrick J. Wong
2023-03-17  2:53     ` Jens Axboe
2023-04-03 12:24 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed4ab2bb-4e77-cf31-a035-741efc12d544@ddn.com \
    --to=bschubert@ddn.com \
    --cc=axboe@kernel.dk \
    --cc=dsingh@ddn.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.