i_version: noversion mount option to disable inode version updates
Subsystems (2)
PATCH 5/5 i_version: noversion mount option to disable inode version updates
Add a "noversion" mount option to disable inode version updates.
fs/ext4/super.c +5 -1
@@ -725,7 +725,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, - Opt_grpquota, Opt_extents, Opt_noextents, + Opt_grpquota, Opt_extents, Opt_noextents, Opt_noversion, }; static match_table_t tokens = {
@@ -777,6 +777,7 @@ static match_table_t tokens = { {Opt_barrier, "barrier=%u"}, {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, + {Opt_noversion, "noversion"}, {Opt_err, NULL}, {Opt_resize, "resize"}, };
@@ -1115,6 +1116,9 @@ clear_qf_name:case Opt_noextents:clear_opt (sbi->s_mount_opt,EXTENTS );break ; +case Opt_noversion: +set_opt (sbi->s_mount_opt,NOVERSION ); +break ;default :printk (KERN_ERR "EXT4-fs: Unrecognized mount option \"%s\" "
include/linux/ext4_fs.h +1 -0
@@ -473,6 +473,7 @@ do { \#define EXT4_MOUNT_USRQUOTA 0x100000/* "old" user quota */ #define EXT4_MOUNT_GRPQUOTA 0x200000/* "old" group quota */ #define EXT4_MOUNT_EXTENTS 0x400000/* Extents support */ +#define EXT4_MOUNT_NOVERSION 0x800000/* No inode version updates */ /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ #ifndef _LINUX_EXT2_FS_H
fs/ext4/inode.c +3 -1
@@ -3082,7 +3082,9 @@ int ext4_mark_iloc_dirty(handle_t *handl {int err =0 ; - inode->i_version++; +if (!test_opt (inode->i_sb,NOVERSION )) + inode->i_version++; +/* the do_update_inode consumes one bh->b_count */ get_bh (iloc->bh);
Quoted 1 line · On Sun, 01 Jul 2007 03:37:53 -0400 Mingming Cao <[email protected]> wrote:
Add a "noversion" mount option to disable inode version updates.
Why is this option being offered to our users? To reduce disk traffic, like noatime?
If so, what are the implications of this? What would the user lose?
Quoted 48 lines
Index:
linux-2.6.21/fs/ext4/super.c
===================================================================fs/ext4/super.c +5
-1@@ -725,7 +725,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, - Opt_grpquota, Opt_extents, Opt_noextents, + Opt_grpquota, Opt_extents, Opt_noextents, Opt_noversion, }; static match_table_t tokens = {@@ -777,6 +777,7 @@ static match_table_t tokens = { {Opt_barrier, "barrier=%u"}, {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, + {Opt_noversion, "noversion"}, {Opt_err, NULL}, {Opt_resize, "resize"}, };@@ -1115,6 +1116,9 @@ clear_qf_name:case Opt_noextents:clear_opt (sbi->s_mount_opt,EXTENTS );break ; +case Opt_noversion: +set_opt (sbi->s_mount_opt,NOVERSION ); +break ;default :printk (KERN_ERR "EXT4-fs: Unrecognized mount option \"%s\" "Index:
linux-2.6.21/include/linux/ext4_fs.h
===================================================================include/linux/ext4_fs.h +1
-0@@ -473,6 +473,7 @@ do { \#define EXT4_MOUNT_USRQUOTA 0x100000/* "old" user quota */ #define EXT4_MOUNT_GRPQUOTA 0x200000/* "old" group quota */ #define EXT4_MOUNT_EXTENTS 0x400000/* Extents support */ +#define EXT4_MOUNT_NOVERSION 0x800000/* No inode version updates */ /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ #ifndef _LINUX_EXT2_FS_HIndex:
linux-2.6.21/fs/ext4/inode.c
===================================================================
fs/ext4/inode.c int ext4_mark_iloc_dirty(handle_t *handl · line 3089
Quoted 9 lines
fs/ext4/inode.c +3
-1@@ -3082,7 +3082,9 @@ int ext4_mark_iloc_dirty(handle_t *handl {int err =0 ; - inode->i_version++; +if (!test_opt (inode->i_sb,NOVERSION )) + inode->i_version++; +/* the do_update_inode consumes one bh->b_count */ get_bh (iloc->bh);
An update to Documentation/filesystems/ext4.txt would be an appropriate way in which to address the above questions.
Quoted 8 lines · Andrew Morton
Quoted 1 line · On Sun, 01 Jul 2007 03:37:53 -0400 Mingming Cao <[email protected]> wrote:
Add a "noversion" mount option to disable inode version updates.
Why is this option being offered to our users? To reduce disk traffic, like noatime?
If so, what are the implications of this? What would the user lose?
Ah, this is the patch to disable i_version updates for Lustre. I don't think any normal user would use this mount option, so I don't know if there is a need to document it. There are no performance implications, unless we end up changing the mtime granularity JUST to update i_version, in which case we can avoid some overhead if not exporting with NFSv4.
If we want to go in the direction of forcing extra inode updates just for this, then we might even consider making i_version updates on disk default to OFF unless NFSv4 has exported the filesystem at least once, and then it should set a persistent flag in the superblock indicating that i_version updates are needed.
Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.
Quoted 3 lines · Andreas Dilger
Ah, this is the patch to disable
i_versionupdates for Lustre. I don't think any normal user would use this mount option, so I don't know if there is a need to document it.
This is a reason to not merge it at all. If the only user of this is the out of tree lustre code there is no need to put this in. I should rather stay in clusterfs' patchkit.
Theodore Tso
maintainerQuoted 9 lines · Andrew Morton
Quoted 1 line · On Sun, 01 Jul 2007 03:37:53 -0400 Mingming Cao <[email protected]> wrote:
Add a "noversion" mount option to disable inode version updates.
Why is this option being offered to our users? To reduce disk traffic, like noatime?
If so, what are the implications of this? What would the user lose?
This has been removed in the latest patch set; it's needed only for Lustre, because they set the version field themselves. Lustre needs the inode version to be globally monotonically increasing, so it can order updates between two different files, so it does this itself. NFSv4 only uses i_version to detect changes, and so there's no need to use a global atomic counter for i_version. So the thinking was that there was no point doing the global atomic counter if it was not necessary.
Since "noversion" is Lustre specific, we've dropped that from the list of patches that we'll push, and so the inode version will only have local per-inode significance, and not have any global ordering properties.
We have not actually benchmarked whether or not doing the global ordering actually *matters* in terms of being actually noticeable. If it isn't noticeable, I wouldn't mind changing things so that we always make i_version globally significant (without a mount option), and make life a bit easier for the Lustre folks. Or if someone other distributed filesystem requests a globally significant i_version. But we can cross that bridge when we get to it....
- Ted