From: Vivek Goyal <vgoyal@redhat.com>
To: JeffleXu <jefflexu@linux.alibaba.com>
Cc: Ira Weiny <ira.weiny@intel.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Theodore Ts'o <tytso@mit.edu>,
adilger.kernel@dilger.ca, linux-xfs@vger.kernel.org,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, dan.j.williams@intel.com,
Christoph Hellwig <hch@lst.de>,
Dave Chinner <dchinner@redhat.com>
Subject: Re: [Question] ext4/xfs: Default behavior changed after per-file DAX
Date: Thu, 28 Oct 2021 09:01:32 -0400 [thread overview]
Message-ID: <YXqfLDLogZlk3m9e@redhat.com> (raw)
In-Reply-To: <665787d0-f227-a95b-37a3-20f2ea3e09aa@linux.alibaba.com>
On Thu, Oct 28, 2021 at 01:52:27PM +0800, JeffleXu wrote:
>
>
> On 10/27/21 10:36 PM, Vivek Goyal wrote:
> > [snip]
> >
> >>
> >> Is the biggest issue the lack of visibility to see if the device supports DAX?
> >
> > Not necessarily. I think for me two biggest issues are.
> >
> > - Should dax be enabled by default in server as well. If we do that,
> > server will have to make extra ioctl() call on every LOOKUP and GETATTR
> > fuse request. Local filesystems probably can easily query FS_XFLAGS_DAX
> > state but doing extra syscall all the time will probably be some cost
> > (No idea how much).
>
> I tested the time cost from virtiofsd's perspective (time cost of
> passthrough_ll.c:lo_do_lookup()):
> - before per inode DAX feature: 2~4 us
> - after per inode DAX feature: 7~8 us
>
> It is within expectation, as the introduction of per inode DAX feature,
> one extra ioctl() system call is introduced.
>
> Also the time cost from client's perspective (time cost of
> fs/fuse/dir.c:fuse_lookup_name())
> - before per inode DAX feature: 25~30 us
> - after per inode DAX feature: 30~35 us
>
> That is, ~15%~20% performance loss.
Hi Jeffle,
Thanks for measuring the performance impact of enabling dax=inode by
default in server.
>
> Currently we do ioctl() to query the persitent inode flags every time
> FUSE_LOOKUP request is received, maybe we could cache the result of
> ioctl() on virtiofsd side, but I have no idea how to intercept the
> runtime modification to these persistent indoe flags from other
> processes on host, e.g. sysadmin on host, to maintain the cache consistency.
>
> So if the default behavior of client side is 'dax=inode', and virtiofsd
> disables per inode DAX by default (neither '-o dax=server|attr' is
> specified for virtiofsd) for the sake of performance, then guest won't
> see DAX enabled and thus won't be surprised. This can reduce the
> behavior change to the minimum.
Agreed. Lets not enable any dax by default in server and let admin/user
enable dax explicitly in server. From fuse client perspective, we can
assume dax=inode by default. That way kernel side behavior will be
similar to ext4/xfs (as long as server has been started with per
inode dax policy).
Vivek
>
>
> >
> > - So far if virtiofs is mounted without any of the dax options, just
> > by looking at mount option, I could tell, DAX is not enabled on any
> > of the files. But that will not be true anymore. Because dax=inode
> > be default, it is possible that server upgrade enabled dax on some
> > or all the files.
> >
> > I guess I will have to stick to same reason given by ext4/xfs. That is
> > to determine whether DAX is enabled on a file or not, you need to
> > query STATX_ATTR_DAX flag. That's the only way to conclude if DAX is
> > being used on a file or not. Don't look at filesystem mount options
> > and reach a conclusion (except the case of dax=never).
>
>
> --
> Thanks,
> Jeffle
>
next prev parent reply other threads:[~2021-10-28 13:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 14:12 [Question] ext4/xfs: Default behavior changed after per-file DAX JeffleXu
2021-10-26 15:48 ` Darrick J. Wong
2021-10-26 19:25 ` Vivek Goyal
2021-10-26 20:57 ` Ira Weiny
2021-10-27 14:36 ` Vivek Goyal
2021-10-28 5:52 ` JeffleXu
2021-10-28 13:01 ` Vivek Goyal [this message]
2021-10-28 18:24 ` Ira Weiny
2021-10-28 19:19 ` Vivek Goyal
2021-10-26 22:33 ` Dave Chinner
2021-10-27 13:14 ` Vivek Goyal
2021-10-28 16:29 ` Eric Sandeen
2021-10-28 16:42 ` Darrick J. Wong
2021-10-27 2:52 ` JeffleXu
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=YXqfLDLogZlk3m9e@redhat.com \
--to=vgoyal@redhat.com \
--cc=adilger.kernel@dilger.ca \
--cc=dan.j.williams@intel.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=ira.weiny@intel.com \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=tytso@mit.edu \
/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).