From: "Daniel P. Berrangé" <berrange@redhat.com>
To: 张佳辰 <zhangjiachen.jaycee@bytedance.com>
Cc: Yongji Xie <xieyongji@bytedance.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [External] Re: [PATCH] virtiofsd: add -o allow_directio|no_directio option
Date: Mon, 24 Aug 2020 10:39:41 +0100 [thread overview]
Message-ID: <20200824093941.GD10011@redhat.com> (raw)
In-Reply-To: <CAFQAk7hqGxNdQJCRn2xsKnyuasPJnHS1hq3azkVc54U2VyDm3Q@mail.gmail.com>
On Sat, Aug 22, 2020 at 01:51:04AM +0800, 张佳辰 wrote:
> On Fri, Aug 21, 2020 at 7:58 PM Daniel P. Berrangé <berrange@redhat.com>
> wrote:
>
> > On Fri, Aug 21, 2020 at 11:41:26AM +0800, Jiachen Zhang wrote:
> > > Due to the commit 65da4539803373ec4eec97ffc49ee90083e56efd, the O_DIRECT
> > > open flag of guest applications will be discarded by virtiofsd. While
> > > this behavior makes it consistent with the virtio-9p scheme when guest
> > > applications using direct I/O, we no longer have any chance to bypass
> > > the host page cache.
> > >
> > > Therefore, we add a flag 'allow_directio' to lo_data. If '-o no_directio'
> > > option is added, or none of '-o no_directio' or '-o allow_directio' is
> > > added, the 'allow_directio' will be set to 0, and virtiofsd discards
> > > O_DIRECT as before. If '-o allow_directio' is added to the stariting
> > > command-line, 'allow_directio' will be set to 1, so that the O_DIRECT
> > > flags will be retained and host page cache can be bypassed.
> > >
> > > Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
> > > ---
> > > tools/virtiofsd/helper.c | 4 ++++
> > > tools/virtiofsd/passthrough_ll.c | 20 ++++++++++++++------
> > > 2 files changed, 18 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> > > index 3105b6c23a..534ff52c64 100644
> > > --- a/tools/virtiofsd/helper.c
> > > +++ b/tools/virtiofsd/helper.c
> > > @@ -180,6 +180,10 @@ void fuse_cmdline_help(void)
> > > " (0 leaves rlimit
> > unchanged)\n"
> > > " default: min(1000000,
> > fs.file-max - 16384)\n"
> > > " if the current
> > rlimit is lower\n"
> > > + " -o allow_directio|no_directio\n"
> > > + " retain/discard O_DIRECT
> > flags passed down\n"
> > > + " to virtiofsd from guest
> > applications.\n"
> > > + " default: no_directio\n"
> > > );
> >
> > The standard naming convention from existing options is to use
> > $OPTNAME and no_$OPTNAME.
> >
> > IOW, don't use the "allow_" prefix. The options should be just
> > "directio" and "no_directio"
> >
> > Thanks, Daniel. I did consider using "directio" instead of "allow_directio"
> before I send out this patch. Although "-o directio" makes it consistent
> with other option names, it may confuse the users of virtiofsd.
> Because currently, virtiofsd will not add an O_DIRECT to the open flag,
> it will just retain or discard the O_DIRECT added by guest applications.
> But "-o direct" may make the users think that virtiofsd will do direct IO
> all
> the time.
Then -o allow_direct_io and -o no_allow_direct_io
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-08-24 9:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 3:41 [PATCH] virtiofsd: add -o allow_directio|no_directio option Jiachen Zhang
2020-08-21 10:53 ` Philippe Mathieu-Daudé
2020-08-21 11:18 ` Stefan Hajnoczi
2020-08-21 11:58 ` Daniel P. Berrangé
2020-08-21 13:40 ` Philippe Mathieu-Daudé
2020-08-21 17:56 ` [External] " 张佳辰
2020-08-21 17:51 ` 张佳辰
2020-08-24 9:39 ` Daniel P. Berrangé [this message]
2020-08-24 9:59 ` Jiachen Zhang
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=20200824093941.GD10011@redhat.com \
--to=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xieyongji@bytedance.com \
--cc=zhangjiachen.jaycee@bytedance.com \
/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;
as well as URLs for NNTP newsgroup(s).