diff mbox series

[V10,04/11] Documentation/dax: Update Usage section

Message ID 20200422212102.3757660-5-ira.weiny@intel.com
State Not Applicable
Headers show
Series XFS - Enable per-file/per-directory DAX operations V10 | expand

Commit Message

Ira Weiny April 22, 2020, 9:20 p.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

Update the Usage section to reflect the new individual dax selection
functionality.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>

---
Changes from V9:
	Fix missing ')'
	Fix trialing '"'

Changes from V8:
	Updates from Darrick

Changes from V7:
	Cleanups/clarifications from Darrick and Dan

Changes from V6:
	Update to allow setting FS_XFLAG_DAX any time.
	Update with list of behaviors from Darrick
	https://lore.kernel.org/lkml/20200409165927.GD6741@magnolia/

Changes from V5:
	Update to reflect the agreed upon semantics
	https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/
---
 Documentation/filesystems/dax.txt | 164 +++++++++++++++++++++++++++++-
 1 file changed, 161 insertions(+), 3 deletions(-)

Comments

Yasunori Goto April 23, 2020, 2:33 a.m. UTC | #1
Hello,

I'm trying use your patch now, and I have a small comment in this document.

On 2020/04/23 6:20, ira.weiny@intel.com wrote:

> +To clarify inheritance here are 3 examples:
> +
> +Example A:
> +
> +mkdir -p a/b/c
> +xfs_io 'chattr +x' a

Probably, "-c" is necessary here.

xfs_io -c 'chattr +x' a


> +mkdir a/b/c/d
> +mkdir a/e
> +
> +	dax: a,e
> +	no dax: b,c,d
> +
> +Example B:
> +
> +mkdir a
> +xfs_io 'chattr +x' a
ditto
> +mkdir -p a/b/c/d
> +
> +	dax: a,b,c,d
> +	no dax:
> +
> +Example C:
> +
> +mkdir -p a/b/c
> +xfs_io 'chattr +x' c
ditto
> +mkdir a/b/c/d
> +
> +	dax: c,d
> +	no dax: a,b
> +
> +

---

Yasunori Goto
Ira Weiny April 23, 2020, 5:05 a.m. UTC | #2
On Thu, Apr 23, 2020 at 11:33:26AM +0900, Yasunori Goto wrote:
> Hello,
> 
> I'm trying use your patch now, and I have a small comment in this document.
> 
> On 2020/04/23 6:20, ira.weiny@intel.com wrote:
> 
> > +To clarify inheritance here are 3 examples:
> > +
> > +Example A:
> > +
> > +mkdir -p a/b/c
> > +xfs_io 'chattr +x' a
> 
> Probably, "-c" is necessary here.
> 
> xfs_io -c 'chattr +x' a

Yes! Thanks!
> 
> 
> > +mkdir a/b/c/d
> > +mkdir a/e
> > +
> > +	dax: a,e
> > +	no dax: b,c,d
> > +
> > +Example B:
> > +
> > +mkdir a
> > +xfs_io 'chattr +x' a
> ditto
> > +mkdir -p a/b/c/d
> > +
> > +	dax: a,b,c,d
> > +	no dax:
> > +
> > +Example C:
> > +
> > +mkdir -p a/b/c
> > +xfs_io 'chattr +x' c
> ditto

Thank you!  Updated.
Ira

> > +mkdir a/b/c/d
> > +
> > +	dax: c,d
> > +	no dax: a,b
> > +
> > +
> 
> ---
> 
> Yasunori Goto
>
Dave Chinner April 23, 2020, 10:27 p.m. UTC | #3
On Wed, Apr 22, 2020 at 02:20:55PM -0700, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> Update the Usage section to reflect the new individual dax selection
> functionality.
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> 
> ---
> Changes from V9:
> 	Fix missing ')'
> 	Fix trialing '"'
> 
> Changes from V8:
> 	Updates from Darrick
> 
> Changes from V7:
> 	Cleanups/clarifications from Darrick and Dan
> 
> Changes from V6:
> 	Update to allow setting FS_XFLAG_DAX any time.
> 	Update with list of behaviors from Darrick
> 	https://lore.kernel.org/lkml/20200409165927.GD6741@magnolia/
> 
> Changes from V5:
> 	Update to reflect the agreed upon semantics
> 	https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/
> ---
>  Documentation/filesystems/dax.txt | 164 +++++++++++++++++++++++++++++-
>  1 file changed, 161 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/filesystems/dax.txt b/Documentation/filesystems/dax.txt
> index 679729442fd2..553712c5054e 100644
> --- a/Documentation/filesystems/dax.txt
> +++ b/Documentation/filesystems/dax.txt
> @@ -17,11 +17,169 @@ For file mappings, the storage device is mapped directly into userspace.
>  Usage
>  -----
>  
> -If you have a block device which supports DAX, you can make a filesystem
> +If you have a block device which supports DAX, you can make a file system
>  on it as usual.  The DAX code currently only supports files with a block
>  size equal to your kernel's PAGE_SIZE, so you may need to specify a block
> -size when creating the filesystem.  When mounting it, use the "-o dax"
> -option on the command line or add 'dax' to the options in /etc/fstab.
> +size when creating the file system.
> +
> +Currently 3 filesystems support DAX: ext2, ext4 and xfs.  Enabling DAX on them
> +is different.
> +
> +Enabling DAX on ext4 and ext2
> +-----------------------------
> +
> +When mounting the filesystem, use the "-o dax" option on the command line or
> +add 'dax' to the options in /etc/fstab.  This works to enable DAX on all files
> +within the filesystem.  It is equivalent to the '-o dax=always' behavior below.
> +
> +
> +Enabling DAX on xfs
> +-------------------
> +
> +Summary
> +-------
> +
> + 1. There exists an in-kernel file access mode flag S_DAX that corresponds to
> +    the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
> +    about this access mode.
> +
> + 2. There exists an advisory file inode flag FS_XFLAG_DAX that is
> +    inherited from the parent directory FS_XFLAG_DAX inode flag at file
> +    creation time.  This advisory flag can be set or cleared at any
> +    time, but doing so does not immediately affect the S_DAX state.

This needs to make it clear that the inheritance behaviour of this
flag affects both newly created regular files and sub-directories,
but no other types of directory entries.

> +
> +    Unless overridden by mount options (see (3)), if FS_XFLAG_DAX is set
> +    and the fs is on pmem then it will enable S_DAX at inode load time;
> +    if FS_XFLAG_DAX is not set, it will not enable S_DAX.

This is item 3), and needs to state that it is specific to regular
files as DAX is not a method that can be used to access the
directory structure.

Also "at inode load time" doesn't really mean anything useful to
users. "when the inode is instantiated in memory by the kernel" is
what you really mean, and given that 5(c) talks about "the kernel
evicts the inode from memory", we really need to use consistent
terminology here so that it's clear to users that the behaviours are
related.

> +
> + 3. There exists a dax= mount option.
> +
> +    "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."
> +
> +    "-o dax=always" means "always set S_DAX (at least on pmem),
> +                    and ignore FS_XFLAG_DAX."
> +
> +    "-o dax"        is an alias for "dax=always".

"Legacy option that is an alias for "dax=always". This may be
deprecated and removed in future, so "dax=always" is the preferred
method for specifying this behaviour."

> +
> +    "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.
> +
> + 4. There exists an advisory directory inode flag FS_XFLAG_DAX that can
> +    be set or cleared at any time.  The flag state is inherited by any files or
> +    subdirectories when they are created within that directory.

This should be item 2, so that it is defined before it is referenced
by the current item 2 in the list.

> +
> + 5. Programs that require a specific file access mode (DAX or not DAX)
> +    can do one of the following:
> +
> +    (a) Create files in directories that the FS_XFLAG_DAX flag set as
> +        needed; or

	(a) Set the parent directory FS_XFLAG_DAX as needed before
	files are created; or

> +    (b) Have the administrator set an override via mount option; or

	(b) Have the administrator set the desired behaviour via
	mount option; or

> +    (c) Set or clear the file's FS_XFLAG_DAX flag as needed.  Programs
> +        must then cause the kernel to evict the inode from memory.  This
> +        can be done by:
> +
> +        i>  Closing the file and re-opening the file and using statx to
> +            see if the fs has changed the S_DAX flag; and

That will almost never work by itself as the cached dentry will
still pin the inode. Suggesting it will lead to people implementing
dumb loops where they open/check/close/sleep because they....

> +        ii> If the file still does not have the desired S_DAX access
> +            mode, either unmount and remount the filesystem, or close
> +            the file and use drop_caches.

.... don't have permissions to do either of these things...

Essentially, you may as well say "reboot the machine" at this point,
because it's effectively the same thing from a production workload
point of view...

Realistically, I'm not sure we should even say "programs must cause
eviction", because that's something they cannot do directly without
admin privileges nor is it something we want to occur randomly on
production machines during production. i.e. this is something that
should only be done in scheduled downtime by an administrator, not
attempted by applications because DAX isn't immediately available.
The admin is in charge here, not the "program".

> + 6. It is expected that users who want to squeeze every last bit of performance
> +    out of the particular rough and tumble bits of their storage will also be
> +    exposed to the difficulties of what happens when the operating system can't
> +    totally virtualize those hardware capabilities.  DAX is such a feature.

I don't think this adds any value. You may as well just say "caveat
empor", but that's kinda implied by the fact a computer is
involved...

> +
> +
> +Details
> +-------
> +
> +There are 2 per-file dax flags.  One is a physical inode setting (FS_XFLAG_DAX)

s/physical/persistent/

> +and the other a currently enabled state (S_DAX).

the other is a volatile flag indicating the active state of the
feature (S_DAX)

> +
> +FS_XFLAG_DAX is maintained, on disk, on individual inodes.

This is implementation detail, not a requirement. The only
requirement is that it is stored persistently by the filesystem.

> It is preserved
> +within the file system.  This 'physical' config setting can be set using an
> +ioctl and/or an application such as "xfs_io -c 'chattr [-+]x'".  Files and

s/physical/persistent/

... can be set, cleared and/or queried use the FS_IOC_FS[GS]ETXATTR
ioctl (see ioctl_xfs_fsgetxattr(2)) or an utility such as 'xfs_io'.
New files and ...

> +directories automatically inherit FS_XFLAG_DAX from their parent directory
> +_when_ _created_.  Therefore, setting FS_XFLAG_DAX at directory creation time
> +can be used to set a default behavior for an entire sub-tree.  (Doing so on the
> +root directory acts to set a default for the entire file system.)

No need for () around the example, but regardless, I don't think
this is a well thought out example. i.e.  setting it on an existing
filesystem which already contains data will not affect the default
behaviour of existing subdirectories or files. IOWs, it only sets the
default behaviour when set on an -empty- filesystem because of the
inheritance characteristics of the flag...

> +The current enabled state (S_DAX) is set when a file inode is _loaded_ based on

instantiated in memoy by the kernel.

> +the underlying media support, the value of FS_XFLAG_DAX, and the file systems

no comma before "and".

> +dax mount option setting.  See below.
> +
> +statx can be used to query S_DAX.  NOTE that a directory will never have S_DAX
> +set and therefore statx will never indicate that S_DAX is set on directories.
> +
> +NOTE: Setting the FS_XFLAG_DAX (specifically or through inheritance) occurs
> +even if the underlying media does not support dax and/or the file system is
> +overridden with a mount option.
> +
> +
> +Overriding FS_XFLAG_DAX (dax= mount option)
> +-------------------------------------------
> +
> +There exists a dax mount option.  Using the mount option does not change the
> +physical configured state of individual files but overrides the S_DAX operating
> +state when inodes are loaded.
> +
> +Given underlying media support, the dax mount option is a tri-state option
> +(never, always, inode) with the following meanings:
> +
> +   "-o dax=never" means "never set S_DAX, ignore FS_XFLAG_DAX"
> +   "-o dax=always" means "always set S_DAX, ignore FS_XFLAG_DAX"
> +        "-o dax" by itself means "dax=always" to remain compatible with older
> +	         kernels
> +   "-o dax=inode" means "follow FS_XFLAG_DAX"

This is just repeating what is in the definition section.

> +The default state is 'inode'.  Given underlying media support, the following
> +algorithm is used to determine the effective mode of the file S_DAX on a
> +capable device.
> +
> +	S_DAX = FS_XFLAG_DAX;
> +
> +	if (dax_mount == "always")
> +		S_DAX = true;
> +	else if (dax_mount == "off")
> +		S_DAX = false;
> +
> +To reiterate: Setting, and inheritance, continues to affect FS_XFLAG_DAX even
> +while the file system is mounted with a dax override.  However, in-core inode
> +state (S_DAX) will continue to be overridden until the filesystem is remounted
> +with dax=inode and the inode is evicted.

Just put this last paragraph up in the "behavioural definitions" and
this whole section can go away.

Cheers,

Dave.
Ira Weiny April 23, 2020, 11:25 p.m. UTC | #4
On Fri, Apr 24, 2020 at 08:27:20AM +1000, Dave Chinner wrote:
> On Wed, Apr 22, 2020 at 02:20:55PM -0700, ira.weiny@intel.com wrote:
> > From: Ira Weiny <ira.weiny@intel.com>
> > 
> > Update the Usage section to reflect the new individual dax selection
> > functionality.
> > 
> > Reviewed-by: Jan Kara <jack@suse.cz>
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > 
> > ---
> > Changes from V9:
> > 	Fix missing ')'
> > 	Fix trialing '"'
> > 
> > Changes from V8:
> > 	Updates from Darrick
> > 
> > Changes from V7:
> > 	Cleanups/clarifications from Darrick and Dan
> > 
> > Changes from V6:
> > 	Update to allow setting FS_XFLAG_DAX any time.
> > 	Update with list of behaviors from Darrick
> > 	https://lore.kernel.org/lkml/20200409165927.GD6741@magnolia/
> > 
> > Changes from V5:
> > 	Update to reflect the agreed upon semantics
> > 	https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/
> > ---
> >  Documentation/filesystems/dax.txt | 164 +++++++++++++++++++++++++++++-
> >  1 file changed, 161 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/filesystems/dax.txt b/Documentation/filesystems/dax.txt
> > index 679729442fd2..553712c5054e 100644
> > --- a/Documentation/filesystems/dax.txt
> > +++ b/Documentation/filesystems/dax.txt
> > @@ -17,11 +17,169 @@ For file mappings, the storage device is mapped directly into userspace.
> >  Usage
> >  -----
> >  
> > -If you have a block device which supports DAX, you can make a filesystem
> > +If you have a block device which supports DAX, you can make a file system
> >  on it as usual.  The DAX code currently only supports files with a block
> >  size equal to your kernel's PAGE_SIZE, so you may need to specify a block
> > -size when creating the filesystem.  When mounting it, use the "-o dax"
> > -option on the command line or add 'dax' to the options in /etc/fstab.
> > +size when creating the file system.
> > +
> > +Currently 3 filesystems support DAX: ext2, ext4 and xfs.  Enabling DAX on them
> > +is different.
> > +
> > +Enabling DAX on ext4 and ext2
> > +-----------------------------
> > +
> > +When mounting the filesystem, use the "-o dax" option on the command line or
> > +add 'dax' to the options in /etc/fstab.  This works to enable DAX on all files
> > +within the filesystem.  It is equivalent to the '-o dax=always' behavior below.
> > +
> > +
> > +Enabling DAX on xfs
> > +-------------------
> > +
> > +Summary
> > +-------
> > +
> > + 1. There exists an in-kernel file access mode flag S_DAX that corresponds to
> > +    the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
> > +    about this access mode.
> > +
> > + 2. There exists an advisory file inode flag FS_XFLAG_DAX that is
> > +    inherited from the parent directory FS_XFLAG_DAX inode flag at file
> > +    creation time.  This advisory flag can be set or cleared at any
> > +    time, but doing so does not immediately affect the S_DAX state.
> 
> This needs to make it clear that the inheritance behaviour of this
> flag affects both newly created regular files and sub-directories,
> but no other types of directory entries.

Done.

> 
> > +
> > +    Unless overridden by mount options (see (3)), if FS_XFLAG_DAX is set
> > +    and the fs is on pmem then it will enable S_DAX at inode load time;
> > +    if FS_XFLAG_DAX is not set, it will not enable S_DAX.
> 
> This is item 3), and needs to state that it is specific to regular
> files as DAX is not a method that can be used to access the
> directory structure.

In 1) S_DAX was defined as being a "file" access mode flag.  I could add
explicit verbiage in 1 to clarify that?

> 
> Also "at inode load time" doesn't really mean anything useful to
> users. "when the inode is instantiated in memory by the kernel" is
> what you really mean, and given that 5(c) talks about "the kernel
> evicts the inode from memory", we really need to use consistent
> terminology here so that it's clear to users that the behaviours are
> related.


> 
> > +
> > + 3. There exists a dax= mount option.
> > +
> > +    "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."
> > +
> > +    "-o dax=always" means "always set S_DAX (at least on pmem),
> > +                    and ignore FS_XFLAG_DAX."
> > +
> > +    "-o dax"        is an alias for "dax=always".
> 
> "Legacy option that is an alias for "dax=always". This may be
> deprecated and removed in future, so "dax=always" is the preferred
> method for specifying this behaviour."

Done.

> 
> > +
> > +    "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.
> > +
> > + 4. There exists an advisory directory inode flag FS_XFLAG_DAX that can
> > +    be set or cleared at any time.  The flag state is inherited by any files or
> > +    subdirectories when they are created within that directory.
> 
> This should be item 2, so that it is defined before it is referenced
> by the current item 2 in the list.

Done.

> 
> > +
> > + 5. Programs that require a specific file access mode (DAX or not DAX)
> > +    can do one of the following:
> > +
> > +    (a) Create files in directories that the FS_XFLAG_DAX flag set as
> > +        needed; or
> 
> 	(a) Set the parent directory FS_XFLAG_DAX as needed before
> 	files are created; or

Done.

> 
> > +    (b) Have the administrator set an override via mount option; or
> 
> 	(b) Have the administrator set the desired behaviour via
> 	mount option; or

Done.

> 
> > +    (c) Set or clear the file's FS_XFLAG_DAX flag as needed.  Programs
> > +        must then cause the kernel to evict the inode from memory.  This
> > +        can be done by:
> > +
> > +        i>  Closing the file and re-opening the file and using statx to
> > +            see if the fs has changed the S_DAX flag; and
> 
> That will almost never work by itself as the cached dentry will
> still pin the inode. Suggesting it will lead to people implementing
> dumb loops where they open/check/close/sleep because they....

loops which ...  will keep loading the inode into the cache...  yea...  :-(

> 
> > +        ii> If the file still does not have the desired S_DAX access
> > +            mode, either unmount and remount the filesystem, or close
> > +            the file and use drop_caches.
> 
> .... don't have permissions to do either of these things...
> 
> Essentially, you may as well say "reboot the machine" at this point,
> because it's effectively the same thing from a production workload
> point of view...
> 
> Realistically, I'm not sure we should even say "programs must cause
> eviction", because that's something they cannot do directly without
> admin privileges nor is it something we want to occur randomly on
> production machines during production. i.e. this is something that
> should only be done in scheduled downtime by an administrator, not
> attempted by applications because DAX isn't immediately available.
> The admin is in charge here, not the "program".

I agree with everything you say.

But I feel a bit stuck here.  Without some type of documentation we are not
allowing FS_XFLAG_DAX to be changed on a file by the user.  Which is what we
were proposing before and we all disliked.

So I feel like we need to say something about getting the inodes evicted.
perhaps by a 'drop cache' even requested of the admin???

Maybe this?


 4. Programs that require a specific file access mode (DAX or not DAX)
    can do one of the following:

    (a) Set the parent directory FS_XFLAG_DAX as needed before file are
        created; or

    (b) Have the administrator set the desired behaviour via mount option; or

    (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
        inode to be evicted from memory.

        i> the only effective way of ensuring this is to request the admin drop
           the file system caches.


> 
> > + 6. It is expected that users who want to squeeze every last bit of performance
> > +    out of the particular rough and tumble bits of their storage will also be
> > +    exposed to the difficulties of what happens when the operating system can't
> > +    totally virtualize those hardware capabilities.  DAX is such a feature.
> 
> I don't think this adds any value. You may as well just say "caveat
> empor", but that's kinda implied by the fact a computer is
> involved..

Deleted.

> 
> > +
> > +
> > +Details
> > +-------
> > +
> > +There are 2 per-file dax flags.  One is a physical inode setting (FS_XFLAG_DAX)
> 
> s/physical/persistent/

Done.

> 
> > +and the other a currently enabled state (S_DAX).
> 
> the other is a volatile flag indicating the active state of the
> feature (S_DAX)

Done.

> 
> > +
> > +FS_XFLAG_DAX is maintained, on disk, on individual inodes.
> 
> This is implementation detail, not a requirement. The only
> requirement is that it is stored persistently by the filesystem.

removed.

> 
> > It is preserved
> > +within the file system.  This 'physical' config setting can be set using an
> > +ioctl and/or an application such as "xfs_io -c 'chattr [-+]x'".  Files and
> 
> s/physical/persistent/
> 
> ... can be set, cleared and/or queried use the FS_IOC_FS[GS]ETXATTR
> ioctl (see ioctl_xfs_fsgetxattr(2)) or an utility such as 'xfs_io'.
> New files and ...

Done.

> 
> > +directories automatically inherit FS_XFLAG_DAX from their parent directory
> > +_when_ _created_.  Therefore, setting FS_XFLAG_DAX at directory creation time
> > +can be used to set a default behavior for an entire sub-tree.  (Doing so on the
> > +root directory acts to set a default for the entire file system.)
> 
> No need for () around the example, but regardless, I don't think
> this is a well thought out example. i.e.  setting it on an existing
> filesystem which already contains data will not affect the default
> behaviour of existing subdirectories or files. IOWs, it only sets the
> default behaviour when set on an -empty- filesystem because of the
> inheritance characteristics of the flag...

I did mention "at directory creation time" which in my mind when extended to
the root directory means when the file system is empty...  But I'll just remove
this example as it provide very little additional information.

> 
> > +The current enabled state (S_DAX) is set when a file inode is _loaded_ based on
> 
> instantiated in memoy by the kernel.

Done.

> 
> > +the underlying media support, the value of FS_XFLAG_DAX, and the file systems
> 
> no comma before "and".

Done.

> 
> > +dax mount option setting.  See below.
> > +
> > +statx can be used to query S_DAX.  NOTE that a directory will never have S_DAX
> > +set and therefore statx will never indicate that S_DAX is set on directories.
> > +
> > +NOTE: Setting the FS_XFLAG_DAX (specifically or through inheritance) occurs
> > +even if the underlying media does not support dax and/or the file system is
> > +overridden with a mount option.
> > +
> > +
> > +Overriding FS_XFLAG_DAX (dax= mount option)
> > +-------------------------------------------
> > +
> > +There exists a dax mount option.  Using the mount option does not change the
> > +physical configured state of individual files but overrides the S_DAX operating
> > +state when inodes are loaded.
> > +
> > +Given underlying media support, the dax mount option is a tri-state option
> > +(never, always, inode) with the following meanings:
> > +
> > +   "-o dax=never" means "never set S_DAX, ignore FS_XFLAG_DAX"
> > +   "-o dax=always" means "always set S_DAX, ignore FS_XFLAG_DAX"
> > +        "-o dax" by itself means "dax=always" to remain compatible with older
> > +	         kernels
> > +   "-o dax=inode" means "follow FS_XFLAG_DAX"
> 
> This is just repeating what is in the definition section.

Removed.

> 
> > +The default state is 'inode'.  Given underlying media support, the following
> > +algorithm is used to determine the effective mode of the file S_DAX on a
> > +capable device.
> > +
> > +	S_DAX = FS_XFLAG_DAX;
> > +
> > +	if (dax_mount == "always")
> > +		S_DAX = true;
> > +	else if (dax_mount == "off")
> > +		S_DAX = false;
> > +
> > +To reiterate: Setting, and inheritance, continues to affect FS_XFLAG_DAX even
> > +while the file system is mounted with a dax override.  However, in-core inode
> > +state (S_DAX) will continue to be overridden until the filesystem is remounted
> > +with dax=inode and the inode is evicted.
> 
> Just put this last paragraph up in the "behavioural definitions" and
> this whole section can go away.

Yep moved above.

To sum up the changes see the entire text below.
Ira


<quote>
Enabling DAX on xfs
-------------------

Summary
-------

 1. There exists an in-kernel file access mode flag S_DAX that corresponds to
    the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
    about this access mode.

 2. There exists a regular file and directory inode flag FS_XFLAG_DAX.  It is
    inherited from the parent directory FS_XFLAG_DAX inode flag at creation
    time.  This advisory flag can be set or cleared at any time, but doing so
    does not immediately affect the S_DAX state.

 3. There exists dax mount options which can override FS_XFLAG_DAX in the
    setting of the S_DAX flag.  Given underlying storage which supports DAX the
    following hold.

    "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.

    "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."

    "-o dax=always" means "always set S_DAX ignore FS_XFLAG_DAX."

    "-o dax"        is a legacy option which is an alias for "dax=always".
    		    This may be removed in the future so "-o dax=always" is
		    the preferred method for specifying this behavior.

    NOTE: Setting and inheritance affect FS_XFLAG_DAX at all times even when
    the file system is mounted with a dax option.  However, in-core inode
    state (S_DAX) will continue to be overridden until the file system is
    remounted with dax=inode and the inode is evicted.

 4. Programs that require a specific file access mode (DAX or not DAX)
    can do one of the following:

    (a) Set the parent directory FS_XFLAG_DAX as needed before file are
        created; or

    (b) Have the administrator set the desired behaviour via mount option; or

    (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
        inode to be evicted from memory.

	i> the only effective way of ensuring this is to request the admin drop
	   the file system caches.


Details
-------

There are 2 per-file dax flags.  One is a persistent inode setting (FS_XFLAG_DAX)
and the other is a volatile flag indicating the active state of the feature
(S_DAX).

FS_XFLAG_DAX is preserved within the file system.  This persistent config
setting can be set, cleared and/or queried using the FS_IOC_FS[GS]ETXATTR ioctl
(see ioctl_xfs_fsgetxattr(2)) or an utility such as 'xfs_io'.
'chattr [-+]x'".

New files and directories automatically inherit FS_XFLAG_DAX from
their parent directory _when_ _created_.  Therefore, setting FS_XFLAG_DAX at
directory creation time can be used to set a default behavior for an entire
sub-tree.

To clarify inheritance here are 3 examples:

Example A:

mkdir -p a/b/c
xfs_io -c 'chattr +x' a
mkdir a/b/c/d
mkdir a/e

	dax: a,e
	no dax: b,c,d

Example B:

mkdir a
xfs_io -c 'chattr +x' a
mkdir -p a/b/c/d

	dax: a,b,c,d
	no dax:

Example C:

mkdir -p a/b/c
xfs_io -c 'chattr +x' c
mkdir a/b/c/d

	dax: c,d
	no dax: a,b


The current enabled state (S_DAX) is set when a file inode is instantiated in
memory by the kernel.  It is set based on the underlying media support, the
value of FS_XFLAG_DAX and the file systems dax mount option setting.

statx can be used to query S_DAX.  NOTE that a directory will never have S_DAX
set and therefore statx will never indicate that S_DAX is set on directories.

Setting the FS_XFLAG_DAX (specifically or through inheritance) occurs even if
the underlying media does not support dax and/or the file system is overridden
with a mount option.

</quote>
Dave Chinner April 24, 2020, 2:15 a.m. UTC | #5
On Thu, Apr 23, 2020 at 04:25:48PM -0700, Ira Weiny wrote:
> On Fri, Apr 24, 2020 at 08:27:20AM +1000, Dave Chinner wrote:
> > On Wed, Apr 22, 2020 at 02:20:55PM -0700, ira.weiny@intel.com wrote:
> > > +    Unless overridden by mount options (see (3)), if FS_XFLAG_DAX is set
> > > +    and the fs is on pmem then it will enable S_DAX at inode load time;
> > > +    if FS_XFLAG_DAX is not set, it will not enable S_DAX.
> > 
> > This is item 3), and needs to state that it is specific to regular
> > files as DAX is not a method that can be used to access the
> > directory structure.
> 
> In 1) S_DAX was defined as being a "file" access mode flag.  I could add
> explicit verbiage in 1 to clarify that?

A "file" can mean a block device, a symlink, a FIFO, etc. If you are
talking about files containing -user data- then it is a "regular
file" and not just a "file". Making sitinctions like this mean it is
clear that S_DAX will not be set on directories and other types of
files in directories...

> > > +        ii> If the file still does not have the desired S_DAX access
> > > +            mode, either unmount and remount the filesystem, or close
> > > +            the file and use drop_caches.
> > 
> > .... don't have permissions to do either of these things...
> > 
> > Essentially, you may as well say "reboot the machine" at this point,
> > because it's effectively the same thing from a production workload
> > point of view...
> > 
> > Realistically, I'm not sure we should even say "programs must cause
> > eviction", because that's something they cannot do directly without
> > admin privileges nor is it something we want to occur randomly on
> > production machines during production. i.e. this is something that
> > should only be done in scheduled downtime by an administrator, not
> > attempted by applications because DAX isn't immediately available.
> > The admin is in charge here, not the "program".
> 
> I agree with everything you say.
> 
> But I feel a bit stuck here.  Without some type of documentation we are not
> allowing FS_XFLAG_DAX to be changed on a file by the user.  Which is what we
> were proposing before and we all disliked.

For production systems, the admin is the "user" we are taking about.
The program itself shouldn't be choosing the method of file data
access; that's up to the administrator in charge of the system to
set the policy how they want it to be set.

i.e. there's a difference between the user/admin taking action to
change a data access policy, and the application taking actions to
override the policy that the admin has set.

What I'm trying to say is that setting/clearing the DAX flags is an
-admin operation-, and part of the consideration of that admin
operation is when the change should take effect.

i.e. refering to "programs" as if they control the access mode is
entirely the wrong way to be looking at persistent inode flags. They
are an administration policy mechanism that belongs to the data set,
not the application (or "program"). Managing data set storage and
access policy is something administrators do, not the application...

> So I feel like we need to say something about getting the inodes evicted.
> perhaps by a 'drop cache' even requested of the admin???
> 
> Maybe this?
> 
> 
>  4. Programs that require a specific file access mode (DAX or not DAX)
>     can do one of the following:
> 
>     (a) Set the parent directory FS_XFLAG_DAX as needed before file are
>         created; or
> 
>     (b) Have the administrator set the desired behaviour via mount option; or
> 
>     (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
>         inode to be evicted from memory.
> 
>         i> the only effective way of ensuring this is to request the admin drop
>            the file system caches.

4. The DAX policy can be changed via:

	a) Set the parent directory FS_XFLAG_DAX as needed before
	   files are created

	b) Set the appropriate dax="foo" mount option

	c) Change the FS_XFLAG_DAX on existing regular files and
	   directories. This has runtime constraints and limitations
	   that are described in 5) below.

5. When changing the DAX policy via toggling the persistent
FS_XFLAG_DAX flag, the change in behaviour for existing regular
files may not occur immediately. If the change must take effect
immediately, the administrator needs to:

	1. stop the application so there are no active references to
	   the data set the policy change will affect
	2. evict the data set from kernel caches so it will be
	   re-instantiated when the application is restarted. This can
	   be acheived by:
		a. drop-caches
		b. a filesystem unmount and mount cycle
		c. a system reboot

Hence if DAX access policy changes are required to take immediate
effect, scheduled system-wide downtime will be required to guarantee
the new policy change takes effect when the application is
restarted.


> <quote>
> Enabling DAX on xfs
> -------------------
> 
> Summary
> -------
> 
>  1. There exists an in-kernel file access mode flag S_DAX that corresponds to
>     the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
>     about this access mode.
> 
>  2. There exists a regular file and directory inode flag FS_XFLAG_DAX.  It is
>     inherited from the parent directory FS_XFLAG_DAX inode flag at creation
>     time.  This advisory flag can be set or cleared at any time, but doing so
>     does not immediately affect the S_DAX state.

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.

3. If the persistent FS_XFLAG_DAX flag is set on a directory, this
flag will be inherited by all regular files and sub directories that
are subsequently created in this directory. Files and subdirectories
that exist at the time this flag is set or cleared on the parent
directory are not modified by this modification of the parent
directory.


> 
>  3. There exists dax mount options which can override FS_XFLAG_DAX in the
>     setting of the S_DAX flag.  Given underlying storage which supports DAX the
>     following hold.
> 
>     "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.
> 
>     "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."
> 
>     "-o dax=always" means "always set S_DAX ignore FS_XFLAG_DAX."
> 
>     "-o dax"        is a legacy option which is an alias for "dax=always".
>     		    This may be removed in the future so "-o dax=always" is
> 		    the preferred method for specifying this behavior.
> 
>     NOTE: Setting and inheritance affect FS_XFLAG_DAX at all times even when
>     the file system is mounted with a dax option.  However, in-core inode
>     state (S_DAX) will continue to be overridden until the file system is

s/continue to//

>     remounted with dax=inode and the inode is evicted.

evicted from kernel memory.

> 
>  4. Programs that require a specific file access mode (DAX or not DAX)
>     can do one of the following:
> 
>     (a) Set the parent directory FS_XFLAG_DAX as needed before file are
>         created; or
> 
>     (b) Have the administrator set the desired behaviour via mount option; or
> 
>     (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
>         inode to be evicted from memory.
> 
> 	i> the only effective way of ensuring this is to request the admin drop
> 	   the file system caches.

See my comments above.

> 
> 
> Details
> -------
> 
> There are 2 per-file dax flags.  One is a persistent inode setting (FS_XFLAG_DAX)
> and the other is a volatile flag indicating the active state of the feature
> (S_DAX).
> 
> FS_XFLAG_DAX is preserved within the file system.  This persistent config
> setting can be set, cleared and/or queried using the FS_IOC_FS[GS]ETXATTR ioctl
> (see ioctl_xfs_fsgetxattr(2)) or an utility such as 'xfs_io'.
> 'chattr [-+]x'".

Stray line.

Cheers,

Dave.
Ira Weiny April 24, 2020, 5:55 a.m. UTC | #6
On Fri, Apr 24, 2020 at 12:15:16PM +1000, Dave Chinner wrote:
> On Thu, Apr 23, 2020 at 04:25:48PM -0700, Ira Weiny wrote:

[snap]

> > > > +        ii> If the file still does not have the desired S_DAX access
> > > > +            mode, either unmount and remount the filesystem, or close
> > > > +            the file and use drop_caches.
> > > 
> > > .... don't have permissions to do either of these things...
> > > 
> > > Essentially, you may as well say "reboot the machine" at this point,
> > > because it's effectively the same thing from a production workload
> > > point of view...
> > > 
> > > Realistically, I'm not sure we should even say "programs must cause
> > > eviction", because that's something they cannot do directly without
> > > admin privileges nor is it something we want to occur randomly on
> > > production machines during production. i.e. this is something that
> > > should only be done in scheduled downtime by an administrator, not
> > > attempted by applications because DAX isn't immediately available.
> > > The admin is in charge here, not the "program".
> > 
> > I agree with everything you say.
> > 
> > But I feel a bit stuck here.  Without some type of documentation we are not
> > allowing FS_XFLAG_DAX to be changed on a file by the user.  Which is what we
> > were proposing before and we all disliked.
> 
> For production systems, the admin is the "user" we are taking about.
> The program itself shouldn't be choosing the method of file data
> access; that's up to the administrator in charge of the system to
> set the policy how they want it to be set.
> 
> i.e. there's a difference between the user/admin taking action to
> change a data access policy, and the application taking actions to
> override the policy that the admin has set.
> 
> What I'm trying to say is that setting/clearing the DAX flags is an
> -admin operation-, and part of the consideration of that admin
> operation is when the change should take effect.
> 
> i.e. refering to "programs" as if they control the access mode is
> entirely the wrong way to be looking at persistent inode flags. They
> are an administration policy mechanism that belongs to the data set,
> not the application (or "program"). Managing data set storage and
> access policy is something administrators do, not the application...

Ok.

> 
> > So I feel like we need to say something about getting the inodes evicted.
> > perhaps by a 'drop cache' even requested of the admin???
> > 
> > Maybe this?
> > 
> > 
> >  4. Programs that require a specific file access mode (DAX or not DAX)
> >     can do one of the following:
> > 
> >     (a) Set the parent directory FS_XFLAG_DAX as needed before file are
> >         created; or
> > 
> >     (b) Have the administrator set the desired behaviour via mount option; or
> > 
> >     (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
> >         inode to be evicted from memory.
> > 
> >         i> the only effective way of ensuring this is to request the admin drop
> >            the file system caches.
> 
> 4. The DAX policy can be changed via:
> 
> 	a) Set the parent directory FS_XFLAG_DAX as needed before
> 	   files are created
> 
> 	b) Set the appropriate dax="foo" mount option
> 
> 	c) Change the FS_XFLAG_DAX on existing regular files and
> 	   directories. This has runtime constraints and limitations
> 	   that are described in 5) below.
> 
> 5. When changing the DAX policy via toggling the persistent
> FS_XFLAG_DAX flag, the change in behaviour for existing regular
> files may not occur immediately. If the change must take effect
> immediately, the administrator needs to:
> 
> 	1. stop the application so there are no active references to
> 	   the data set the policy change will affect
> 	2. evict the data set from kernel caches so it will be
> 	   re-instantiated when the application is restarted. This can
> 	   be acheived by:
> 		a. drop-caches
> 		b. a filesystem unmount and mount cycle
> 		c. a system reboot
> 
> Hence if DAX access policy changes are required to take immediate
> effect, scheduled system-wide downtime will be required to guarantee
> the new policy change takes effect when the application is
> restarted.
> 
> 
> > <quote>
> > Enabling DAX on xfs
> > -------------------
> > 
> > Summary
> > -------
> > 
> >  1. There exists an in-kernel file access mode flag S_DAX that corresponds to
> >     the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
> >     about this access mode.
> > 
> >  2. There exists a regular file and directory inode flag FS_XFLAG_DAX.  It is
> >     inherited from the parent directory FS_XFLAG_DAX inode flag at creation
> >     time.  This advisory flag can be set or cleared at any time, but doing so
> >     does not immediately affect the S_DAX state.
> 
> 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.

Done.

> 
> 3. If the persistent FS_XFLAG_DAX flag is set on a directory, this
> flag will be inherited by all regular files and sub directories that
> are subsequently created in this directory. Files and subdirectories
> that exist at the time this flag is set or cleared on the parent
> directory are not modified by this modification of the parent
> directory.
> 

Done.

> 
> > 
> >  3. There exists dax mount options which can override FS_XFLAG_DAX in the
> >     setting of the S_DAX flag.  Given underlying storage which supports DAX the
> >     following hold.
> > 
> >     "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.
> > 
> >     "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."
> > 
> >     "-o dax=always" means "always set S_DAX ignore FS_XFLAG_DAX."
> > 
> >     "-o dax"        is a legacy option which is an alias for "dax=always".
> >     		    This may be removed in the future so "-o dax=always" is
> > 		    the preferred method for specifying this behavior.
> > 
> >     NOTE: Setting and inheritance affect FS_XFLAG_DAX at all times even when
> >     the file system is mounted with a dax option.  However, in-core inode
> >     state (S_DAX) will continue to be overridden until the file system is
> 
> s/continue to//

Done.

> 
> >     remounted with dax=inode and the inode is evicted.
> 
> evicted from kernel memory.

Done.

> 
> > 
> >  4. Programs that require a specific file access mode (DAX or not DAX)
> >     can do one of the following:
> > 
> >     (a) Set the parent directory FS_XFLAG_DAX as needed before file are
> >         created; or
> > 
> >     (b) Have the administrator set the desired behaviour via mount option; or
> > 
> >     (c) Set or clear the file's FS_XFLAG_DAX flag as needed and wait for the
> >         inode to be evicted from memory.
> > 
> > 	i> the only effective way of ensuring this is to request the admin drop
> > 	   the file system caches.
> 
> See my comments above.

Done. thanks!

> 
> > 
> > 
> > Details
> > -------
> > 
> > There are 2 per-file dax flags.  One is a persistent inode setting (FS_XFLAG_DAX)
> > and the other is a volatile flag indicating the active state of the feature
> > (S_DAX).
> > 
> > FS_XFLAG_DAX is preserved within the file system.  This persistent config
> > setting can be set, cleared and/or queried using the FS_IOC_FS[GS]ETXATTR ioctl
> > (see ioctl_xfs_fsgetxattr(2)) or an utility such as 'xfs_io'.
> > 'chattr [-+]x'".
> 
> Stray line.

Thanks for the review!  V11 should be out soon.

Ira

> 
> Cheers,
> 
> Dave.
> 
> -- 
> Dave Chinner
> david@fromorbit.com
diff mbox series

Patch

diff --git a/Documentation/filesystems/dax.txt b/Documentation/filesystems/dax.txt
index 679729442fd2..553712c5054e 100644
--- a/Documentation/filesystems/dax.txt
+++ b/Documentation/filesystems/dax.txt
@@ -17,11 +17,169 @@  For file mappings, the storage device is mapped directly into userspace.
 Usage
 -----
 
-If you have a block device which supports DAX, you can make a filesystem
+If you have a block device which supports DAX, you can make a file system
 on it as usual.  The DAX code currently only supports files with a block
 size equal to your kernel's PAGE_SIZE, so you may need to specify a block
-size when creating the filesystem.  When mounting it, use the "-o dax"
-option on the command line or add 'dax' to the options in /etc/fstab.
+size when creating the file system.
+
+Currently 3 filesystems support DAX: ext2, ext4 and xfs.  Enabling DAX on them
+is different.
+
+Enabling DAX on ext4 and ext2
+-----------------------------
+
+When mounting the filesystem, use the "-o dax" option on the command line or
+add 'dax' to the options in /etc/fstab.  This works to enable DAX on all files
+within the filesystem.  It is equivalent to the '-o dax=always' behavior below.
+
+
+Enabling DAX on xfs
+-------------------
+
+Summary
+-------
+
+ 1. There exists an in-kernel file access mode flag S_DAX that corresponds to
+    the statx flag STATX_ATTR_DAX.  See the manpage for statx(2) for details
+    about this access mode.
+
+ 2. There exists an advisory file inode flag FS_XFLAG_DAX that is
+    inherited from the parent directory FS_XFLAG_DAX inode flag at file
+    creation time.  This advisory flag can be set or cleared at any
+    time, but doing so does not immediately affect the S_DAX state.
+
+    Unless overridden by mount options (see (3)), if FS_XFLAG_DAX is set
+    and the fs is on pmem then it will enable S_DAX at inode load time;
+    if FS_XFLAG_DAX is not set, it will not enable S_DAX.
+
+ 3. There exists a dax= mount option.
+
+    "-o dax=never"  means "never set S_DAX, ignore FS_XFLAG_DAX."
+
+    "-o dax=always" means "always set S_DAX (at least on pmem),
+                    and ignore FS_XFLAG_DAX."
+
+    "-o dax"        is an alias for "dax=always".
+
+    "-o dax=inode"  means "follow FS_XFLAG_DAX" and is the default.
+
+ 4. There exists an advisory directory inode flag FS_XFLAG_DAX that can
+    be set or cleared at any time.  The flag state is inherited by any files or
+    subdirectories when they are created within that directory.
+
+ 5. Programs that require a specific file access mode (DAX or not DAX)
+    can do one of the following:
+
+    (a) Create files in directories that the FS_XFLAG_DAX flag set as
+        needed; or
+
+    (b) Have the administrator set an override via mount option; or
+
+    (c) Set or clear the file's FS_XFLAG_DAX flag as needed.  Programs
+        must then cause the kernel to evict the inode from memory.  This
+        can be done by:
+
+        i>  Closing the file and re-opening the file and using statx to
+            see if the fs has changed the S_DAX flag; and
+
+        ii> If the file still does not have the desired S_DAX access
+            mode, either unmount and remount the filesystem, or close
+            the file and use drop_caches.
+
+ 6. It is expected that users who want to squeeze every last bit of performance
+    out of the particular rough and tumble bits of their storage will also be
+    exposed to the difficulties of what happens when the operating system can't
+    totally virtualize those hardware capabilities.  DAX is such a feature.
+
+
+Details
+-------
+
+There are 2 per-file dax flags.  One is a physical inode setting (FS_XFLAG_DAX)
+and the other a currently enabled state (S_DAX).
+
+FS_XFLAG_DAX is maintained, on disk, on individual inodes.  It is preserved
+within the file system.  This 'physical' config setting can be set using an
+ioctl and/or an application such as "xfs_io -c 'chattr [-+]x'".  Files and
+directories automatically inherit FS_XFLAG_DAX from their parent directory
+_when_ _created_.  Therefore, setting FS_XFLAG_DAX at directory creation time
+can be used to set a default behavior for an entire sub-tree.  (Doing so on the
+root directory acts to set a default for the entire file system.)
+
+To clarify inheritance here are 3 examples:
+
+Example A:
+
+mkdir -p a/b/c
+xfs_io 'chattr +x' a
+mkdir a/b/c/d
+mkdir a/e
+
+	dax: a,e
+	no dax: b,c,d
+
+Example B:
+
+mkdir a
+xfs_io 'chattr +x' a
+mkdir -p a/b/c/d
+
+	dax: a,b,c,d
+	no dax:
+
+Example C:
+
+mkdir -p a/b/c
+xfs_io 'chattr +x' c
+mkdir a/b/c/d
+
+	dax: c,d
+	no dax: a,b
+
+
+The current enabled state (S_DAX) is set when a file inode is _loaded_ based on
+the underlying media support, the value of FS_XFLAG_DAX, and the file systems
+dax mount option setting.  See below.
+
+statx can be used to query S_DAX.  NOTE that a directory will never have S_DAX
+set and therefore statx will never indicate that S_DAX is set on directories.
+
+NOTE: Setting the FS_XFLAG_DAX (specifically or through inheritance) occurs
+even if the underlying media does not support dax and/or the file system is
+overridden with a mount option.
+
+
+Overriding FS_XFLAG_DAX (dax= mount option)
+-------------------------------------------
+
+There exists a dax mount option.  Using the mount option does not change the
+physical configured state of individual files but overrides the S_DAX operating
+state when inodes are loaded.
+
+Given underlying media support, the dax mount option is a tri-state option
+(never, always, inode) with the following meanings:
+
+   "-o dax=never" means "never set S_DAX, ignore FS_XFLAG_DAX"
+   "-o dax=always" means "always set S_DAX, ignore FS_XFLAG_DAX"
+        "-o dax" by itself means "dax=always" to remain compatible with older
+	         kernels
+   "-o dax=inode" means "follow FS_XFLAG_DAX"
+
+The default state is 'inode'.  Given underlying media support, the following
+algorithm is used to determine the effective mode of the file S_DAX on a
+capable device.
+
+	S_DAX = FS_XFLAG_DAX;
+
+	if (dax_mount == "always")
+		S_DAX = true;
+	else if (dax_mount == "off")
+		S_DAX = false;
+
+To reiterate: Setting, and inheritance, continues to affect FS_XFLAG_DAX even
+while the file system is mounted with a dax override.  However, in-core inode
+state (S_DAX) will continue to be overridden until the filesystem is remounted
+with dax=inode and the inode is evicted.
 
 
 Implementation Tips for Block Driver Writers