All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [Question] can we make dax flag per-inode
@ 2021-05-18 19:00 Liu Bo
  2021-05-18 20:34 ` Vivek Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Bo @ 2021-05-18 19:00 UTC (permalink / raw)
  To: virtio-fs; +Cc: vgoyal

Hi,

Currently dax mode is enabled through the mount option "dax", and it
affects all the file IO under virtiofs (Correct me if I was wrong).

My case is that there is only one virtiofs mount point in the guest,
but I don't think that dax would benefit all the files, such as some
files may only be accessed once and setupmapping+page fault overhead
is too much in such cases, thus I would like to see dax flag as a per
inode flag.

So the questions come to, a) how do we set dax flags (we can do chattr
or fuse specific flags passed from the server side), b) should it be
toggled only once?

thanks,
liubo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Virtio-fs] [Question] can we make dax flag per-inode
  2021-05-18 19:00 [Virtio-fs] [Question] can we make dax flag per-inode Liu Bo
@ 2021-05-18 20:34 ` Vivek Goyal
  2021-05-21  1:03   ` Liu Bo
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Goyal @ 2021-05-18 20:34 UTC (permalink / raw)
  To: Liu Bo; +Cc: virtio-fs

On Wed, May 19, 2021 at 03:00:59AM +0800, Liu Bo wrote:
> Hi,
> 
> Currently dax mode is enabled through the mount option "dax", and it
> affects all the file IO under virtiofs (Correct me if I was wrong).
> 
> My case is that there is only one virtiofs mount point in the guest,
> but I don't think that dax would benefit all the files, such as some
> files may only be accessed once and setupmapping+page fault overhead
> is too much in such cases, thus I would like to see dax flag as a per
> inode flag.

So you know enough about filesystem and workload so you have figured
out which files will benefit from dax? I am assuming its not just
about file size. Because workload has to keep file mapped and reuse
that data many times to benfit from dax.

> 
> So the questions come to, a) how do we set dax flags (we can do chattr
> or fuse specific flags passed from the server side), b) should it be
> toggled only once?

I think recently xfs added per inode dax flag option.
Documentation/filesystem/dax.txt says.

 2. There exists a persistent flag FS_XFLAG_DAX that can be applied to regular
    files and directories. This advisory flag can be set or cleared at any
    time, but doing so does not immediately affect the S_DAX state.

So looks like we can look at similar approach. Set this flag on a file
/directory we want to enable DAX on and then mount virtiofs with
option "cache=inode".

Not sure how much of work it is and if there are specific challenges
in the context of fuse. Give it a try.

Thanks
Vivek


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Virtio-fs] [Question] can we make dax flag per-inode
  2021-05-18 20:34 ` Vivek Goyal
@ 2021-05-21  1:03   ` Liu Bo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Bo @ 2021-05-21  1:03 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: virtio-fs

On Tue, May 18, 2021 at 04:34:50PM -0400, Vivek Goyal wrote:
> On Wed, May 19, 2021 at 03:00:59AM +0800, Liu Bo wrote:
> > Hi,
> > 
> > Currently dax mode is enabled through the mount option "dax", and it
> > affects all the file IO under virtiofs (Correct me if I was wrong).
> > 
> > My case is that there is only one virtiofs mount point in the guest,
> > but I don't think that dax would benefit all the files, such as some
> > files may only be accessed once and setupmapping+page fault overhead
> > is too much in such cases, thus I would like to see dax flag as a per
> > inode flag.
> 
> So you know enough about filesystem and workload so you have figured
> out which files will benefit from dax? I am assuming its not just
> about file size. Because workload has to keep file mapped and reuse
> that data many times to benfit from dax.

In our internal use case, there are some readonly files that are
shared between guest and hosts, and they will be loaded into memory
for instant access, with the help of dax, the "double page cache"
issue doesn't exist any more.

> 
> > 
> > So the questions come to, a) how do we set dax flags (we can do chattr
> > or fuse specific flags passed from the server side), b) should it be
> > toggled only once?
> 
> I think recently xfs added per inode dax flag option.
> Documentation/filesystem/dax.txt says.
> 
>  2. There exists a persistent flag FS_XFLAG_DAX that can be applied to regular
>     files and directories. This advisory flag can be set or cleared at any
>     time, but doing so does not immediately affect the S_DAX state.
> 
> So looks like we can look at similar approach. Set this flag on a file
> /directory we want to enable DAX on and then mount virtiofs with
> option "cache=inode".
> 
> Not sure how much of work it is and if there are specific challenges
> in the context of fuse. Give it a try.
>

Good to know it.

thanks,
liubo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-21  1:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 19:00 [Virtio-fs] [Question] can we make dax flag per-inode Liu Bo
2021-05-18 20:34 ` Vivek Goyal
2021-05-21  1:03   ` Liu Bo

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.