From: yangyun <yangyun50@huawei.com>
To: <miklos@szeredi.hu>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<lixiaokeng@huawei.com>, <yangyun50@huawei.com>
Subject: Re:[PATCH] fuse: remove useless IOCB_DIRECT in fuse_direct_read/write_iter
Date: Tue, 27 Aug 2024 19:41:46 +0800 [thread overview]
Message-ID: <20240827114146.3474592-1-yangyun50@huawei.com> (raw)
In-Reply-To: <CAJfpegt_P=Dj-CXnbZYK+XZW8ZwNH0_Str30q9vub0o00UMuWQ@mail.gmail.com>
On Mon, Aug 26, 2024 at 09:12:39PM +0200, Miklos Szeredi wrote:
> On Mon, 26 Aug 2024 at 15:07, yangyun <yangyun50@huawei.com> wrote:
> >
> > Commit 23c94e1cdcbf ("fuse: Switch to using async direct IO
> > for FOPEN_DIRECT_IO") gave the async direct IO code path in the
> > fuse_direct_read_iter() and fuse_direct_write_iter(). But since
> > these two functions are only called under FOPEN_DIRECT_IO is set,
> > it seems that we can also use the async direct IO even the flag
> > IOCB_DIRECT is not set to enjoy the async direct IO method. Also
> > move the definition of fuse_io_priv to where it is used in fuse_
> > direct_write_iter.
>
> I'm interested in the motivation for this patch.
>
> There's a minor risk of regressions when introducing such a behavior
> change, so there should also be a strong supporting argument, which
> seems to be missing in this case.
Thanks for your reply!
It seems that there is a risk of regressions. But I think adding an argument
in this case is not so graceful, whatever adding this argument to the
`struct fuse_file->open_flags` or adding it to the init flags in `struct
fuse_init_args`.
The reasons are:
1. Commit 23c94e1cdcbf ("fuse: Switch to using async direct IO for FOPEN_DIRECT_IO")
also changes the behavior from sync to async direct io, but does not import a new
argument to avoid the risk of regressions.
2. Fuse already has an init flags FUSE_ASYNC_DIO in `fuse_init_args`, which indicates
that the direct io should be submitted asynchrounously. The comment in function
`fuse_direct_IO()` also indicates the situation:
"
/*
* By default, we want to optimize all I/Os with async request
* submission to the client filesystem if supported.
*/
"
But the code does not go through the async direct io code path in the case described in current patch.
3. If adding a argument, it would be so many arguments about async and direct io (FUSE_ASYNC_DIO,
FUSE_ASYNC_READ, FOPEN_DIRECT_IO, etc), which may be redundant and confuse the developers about
their differences.
What do you think ?
>
> Thanks,
> Miklos
prev parent reply other threads:[~2024-08-27 11:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 13:06 [PATCH] " yangyun
2024-08-26 19:12 ` Miklos Szeredi
2024-08-27 8:30 ` Jingbo Xu
2024-08-27 11:52 ` yangyun
2024-10-07 12:35 ` Miklos Szeredi
2024-08-27 11:41 ` yangyun [this message]
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=20240827114146.3474592-1-yangyun50@huawei.com \
--to=yangyun50@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lixiaokeng@huawei.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®