f2fs: enable inline data by default
Subsystems (3)
PATCH v2 1/2 f2fs: enable inline data by default
Enable inline_data feature by default since it brings us better performance and space utilization and now has already stable. Add another option noinline_data to disable it during mount.
---
v1 -> v2:
* retain inline_data option and enable it by default
* add another noinline_data option
Documentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/inline.c | 2 +- fs/f2fs/super.c | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-)
Documentation/filesystems/f2fs.txt +2 -0
@@ -144,6 +144,8 @@ extent_cache Enable an extent cache based on rb-tree, it can cache as many as extent which map between contiguous logical address and physical address per inode, resulting in increasing the cache hit ratio. +noinline_data Disable the inline data feature, inline data feature is + enabled by default. ================================================================================ DEBUGFS ENTRIES
fs/f2fs/f2fs.h +1 -0
@@ -51,6 +51,7 @@#define F2FS_MOUNT_NOBARRIER 0x00000800#define F2FS_MOUNT_FASTBOOT 0x00001000#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 +#define F2FS_MOUNT_NOINLINE_DATA 0x00004000#define clear_opt (sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)#define set_opt (sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)
fs/f2fs/inline.c +1 -1
@@ -15,7 +15,7 @@bool f2fs_may_inline (struct inode *inode) { -if (!test_opt (F2FS_I_SB (inode),INLINE_DATA )) +if (!test_opt (F2FS_I_SB (inode),NOINLINE_DATA ))return false;if (f2fs_is_atomic_file (inode))
fs/f2fs/super.c +8 -0
@@ -58,6 +58,7 @@ enum { Opt_nobarrier, Opt_fastboot, Opt_extent_cache, + Opt_noinline_data, Opt_err, };
@@ -80,6 +81,7 @@ static match_table_t f2fs_tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_fastboot, "fastboot"}, {Opt_extent_cache, "extent_cache"}, + {Opt_noinline_data, "noinline_data"}, {Opt_err, NULL}, };
@@ -372,6 +374,9 @@ static int parse_options(struct super_block *sb, char *options)case Opt_extent_cache:set_opt (sbi,EXTENT_CACHE );break ; +case Opt_noinline_data: +set_opt (sbi,NOINLINE_DATA ); +break ;default : f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value",
@@ -606,6 +611,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",fastboot" );if (test_opt (sbi,EXTENT_CACHE ))seq_puts (seq,",extent_cache" ); +if (test_opt (sbi,NOINLINE_DATA )) +seq_puts (seq,",noinline_data" );seq_printf (seq,",active_logs=%u" , sbi->active_logs);return 0 ;
@@ -991,6 +998,7 @@ try_onemore: sbi->active_logs =NR_CURSEG_TYPE ;set_opt (sbi,BG_GC ); +set_opt (sbi,INLINE_DATA );#ifdef CONFIG_F2FS_FS_XATTR set_opt (sbi,XATTR_USER );
Signature · 9 lines
1.9.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
PATCH v2 2/2 f2fs: enable fast symlink by utilizing inline data
Fast symlink can utilize inline data flow to avoid using any i_addr region, since we need to handle many cases such as truncation, roll-forward recovery, and fsck/dump tools.
--- fs/f2fs/inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inline.c +1 -1
@@ -21,7 +21,7 @@ bool f2fs_may_inline(struct inode *inode)if (f2fs_is_atomic_file (inode))return false; -if (!S_ISREG (inode->i_mode)) +if (!S_ISREG (inode->i_mode) && !S_ISLNK (inode->i_mode))return false;if (i_size_read (inode) >MAX_INLINE_DATA )
Signature · 9 lines
1.9.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
Hi Wanpeng,
Quoted 44 lines
-----Original Message-----
From: Wanpeng Li [mailto:[email protected]]
Sent: Monday, March 23, 2015 7:44 AM
To: Jaegeuk Kim
Cc: Changman Lee; Chao Yu; [email protected]; [email protected]; [email protected]; Wanpeng Li
Subject: [PATCH v2 1/2] f2fs: enable inline data by defaultEnable
inline_datafeature by default since it brings us better performance and space utilization and now has already stable. Add another optionnoinline_datato disable it during mount.Suggested-by Jaegeuk Kim <[email protected]>Suggested-by Chao Yu <[email protected]>Signed-off-by Wanpeng Li <[email protected]>---
v1 -> v2:
* retaininline_dataoption and enable it by default
* add anothernoinline_dataoptionDocumentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/inline.c | 2 +- fs/f2fs/super.c | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-)Documentation/filesystems/f2fs.txt +2
-0@@ -144,6 +144,8 @@ extent_cache Enable an extent cache based on rb-tree, it can cache as many as extent which map between contiguous logical address and physical address per inode, resulting in increasing the cache hit ratio. +noinline_data Disable the inline data feature, inline data feature is + enabled by default. ================================================================================ DEBUGFS ENTRIESfs/f2fs/f2fs.h +0
-0
fs/f2fs/f2fs.h line 54
Quoted 4 lines
fs/f2fs/f2fs.h +1
-0@@ -51,6 +51,7 @@#define F2FS_MOUNT_NOBARRIER 0x00000800#define F2FS_MOUNT_FASTBOOT 0x00001000#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 +#define F2FS_MOUNT_NOINLINE_DATA 0x00004000
May be we could reuse F2FS_MOUNT_INLINE_DATA for saving inline/noinline status like F2FS_MOUNT_BG_GC.
e.g.parse_options:
case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); break;
f2fs_show_options:
if (test_opt(sbi, INLINE_DATA)) seq_puts(seq, ",inline_data"); else seq_puts(seq, ",noinline_data");
So we can avoid to show both options "inline_data,noinline_data" in ->show_options if we mount with noinline_data, since this will make our user confused.
How do you think?
Thanks,
Quoted 65 lines
fs/f2fs/f2fs.h +0
-0#define clear_opt (sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)#define set_opt (sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)fs/f2fs/inline.c +1
-1@@ -15,7 +15,7 @@bool f2fs_may_inline (struct inode *inode) { -if (!test_opt (F2FS_I_SB (inode),INLINE_DATA )) +if (!test_opt (F2FS_I_SB (inode),NOINLINE_DATA ))return false;if (f2fs_is_atomic_file (inode))fs/f2fs/super.c +8
-1@@ -58,6 +58,7 @@ enum { Opt_nobarrier, Opt_fastboot, Opt_extent_cache, + Opt_noinline_data, Opt_err, };@@ -80,6 +81,7 @@ static match_table_t f2fs_tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_fastboot, "fastboot"}, {Opt_extent_cache, "extent_cache"}, + {Opt_noinline_data, "noinline_data"}, {Opt_err, NULL}, };@@ -372,6 +374,9 @@ static int parse_options(struct super_block *sb, char *options)case Opt_extent_cache:set_opt (sbi,EXTENT_CACHE );break ; +case Opt_noinline_data: +set_opt (sbi,NOINLINE_DATA ); +break ;default : f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value",@@ -606,6 +611,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",fastboot" );if (test_opt (sbi,EXTENT_CACHE ))seq_puts (seq,",extent_cache" ); +if (test_opt (sbi,NOINLINE_DATA )) +seq_puts (seq,",noinline_data" );seq_printf (seq,",active_logs=%u" , sbi->active_logs);return 0 ;@@ -991,6 +998,7 @@ try_onemore: sbi->active_logs =NR_CURSEG_TYPE ;set_opt (sbi,BG_GC ); +set_opt (sbi,INLINE_DATA );#ifdef CONFIG_F2FS_FS_XATTR set_opt (sbi,XATTR_USER ); --1.9.1
Hi Chao,
Quoted 60 lines · Chao Yu
Hi Wanpeng,
Quoted 44 lines
-----Original Message-----
From: Wanpeng Li [mailto:[email protected]]
Sent: Monday, March 23, 2015 7:44 AM
To: Jaegeuk Kim
Cc: Changman Lee; Chao Yu; [email protected]; [email protected]; [email protected]; Wanpeng Li
Subject: [PATCH v2 1/2] f2fs: enable inline data by defaultEnable
inline_datafeature by default since it brings us better performance and space utilization and now has already stable. Add another optionnoinline_datato disable it during mount.Suggested-by Jaegeuk Kim <[email protected]>Suggested-by Chao Yu <[email protected]>Signed-off-by Wanpeng Li <[email protected]>---
v1 -> v2:
* retaininline_dataoption and enable it by default
* add anothernoinline_dataoptionDocumentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/inline.c | 2 +- fs/f2fs/super.c | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-)Documentation/filesystems/f2fs.txt +2
-0@@ -144,6 +144,8 @@ extent_cache Enable an extent cache based on rb-tree, it can cache as many as extent which map between contiguous logical address and physical address per inode, resulting in increasing the cache hit ratio. +noinline_data Disable the inline data feature, inline data feature is + enabled by default. ================================================================================ DEBUGFS ENTRIESfs/f2fs/f2fs.h +0
-0fs/f2fs/f2fs.h line 54
Quoted 4 lines
fs/f2fs/f2fs.h +1
-0@@ -51,6 +51,7 @@#define F2FS_MOUNT_NOBARRIER 0x00000800#define F2FS_MOUNT_FASTBOOT 0x00001000#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 +#define F2FS_MOUNT_NOINLINE_DATA 0x00004000May be we could reuse
F2FS_MOUNT_INLINE_DATAfor saving inline/noinline status likeF2FS_MOUNT_BG_GC.e.g.
parse_options:case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); break;
Quoted 8 lines
f2fs_show_options:if (test_opt(sbi, INLINE_DATA)) seq_puts(seq, ",inline_data"); else seq_puts(seq, ",noinline_data");So we can avoid to show both options "inline_data,noinline_data" in ->show_options if we mount with
noinline_data, since this will make our user confused.
I didn't see "inline_data, noinline_data" w/ noinline_data mount option, just "rw,noinline_data" dump out.
Ping Jaegeuk!
Regards,
Wanpeng Li
Quoted 63 lines
How do you think?
Thanks,
Quoted 58 lines
fs/f2fs/f2fs.h +0
-0#define clear_opt (sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)#define set_opt (sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)fs/f2fs/inline.c +1
-1@@ -15,7 +15,7 @@bool f2fs_may_inline (struct inode *inode) { -if (!test_opt (F2FS_I_SB (inode),INLINE_DATA )) +if (!test_opt (F2FS_I_SB (inode),NOINLINE_DATA ))return false;if (f2fs_is_atomic_file (inode))fs/f2fs/super.c +7
-0@@ -58,6 +58,7 @@ enum { Opt_nobarrier, Opt_fastboot, Opt_extent_cache, + Opt_noinline_data, Opt_err, };@@ -80,6 +81,7 @@ static match_table_t f2fs_tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_fastboot, "fastboot"}, {Opt_extent_cache, "extent_cache"}, + {Opt_noinline_data, "noinline_data"}, {Opt_err, NULL}, };@@ -372,6 +374,9 @@ static int parse_options(struct super_block *sb, char *options)case Opt_extent_cache:set_opt (sbi,EXTENT_CACHE );break ; +case Opt_noinline_data: +set_opt (sbi,NOINLINE_DATA ); +break ;default : f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value",@@ -606,6 +611,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",fastboot" );if (test_opt (sbi,EXTENT_CACHE ))seq_puts (seq,",extent_cache" ); +if (test_opt (sbi,NOINLINE_DATA )) +seq_puts (seq,",noinline_data" );seq_printf (seq,",active_logs=%u" , sbi->active_logs);return 0 ;@@ -991,6 +998,7 @@ try_onemore: sbi->active_logs =NR_CURSEG_TYPE ;
Quoted 7 lines
Quoted 7 lines
fs/f2fs/super.c +1
-1set_opt (sbi,BG_GC ); +set_opt (sbi,INLINE_DATA );#ifdef CONFIG_F2FS_FS_XATTR set_opt (sbi,XATTR_USER ); --1.9.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
Hi Wanpeng,
Quoted 38 lines
-----Original Message-----
From: Wanpeng Li [mailto:[email protected]]
Sent: Monday, March 23, 2015 3:15 PM
To: Chao Yu
Cc: 'Jaegeuk Kim'; 'Changman Lee'; [email protected]; [email protected]; [email protected]; Wanpeng Li
Subject: Re: [PATCH v2 1/2] f2fs: enable inline data by defaultHi Chao,
Quoted 28 lines · Chao Yu
Hi Wanpeng,
Quoted 26 lines
-----Original Message-----
From: Wanpeng Li [mailto:[email protected]]
Sent: Monday, March 23, 2015 7:44 AM
To: Jaegeuk Kim
Cc: Changman Lee; Chao Yu; [email protected]; [email protected]; [email protected]; Wanpeng Li
Subject: [PATCH v2 1/2] f2fs: enable inline data by defaultEnable
inline_datafeature by default since it brings us better performance and space utilization and now has already stable. Add another optionnoinline_datato disable it during mount.Suggested-by Jaegeuk Kim <[email protected]>Suggested-by Chao Yu <[email protected]>Signed-off-by Wanpeng Li <[email protected]>---
v1 -> v2:
* retaininline_dataoption and enable it by default
* add anothernoinline_dataoptionDocumentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 1 + fs/f2fs/inline.c | 2 +- fs/f2fs/super.c | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-)
Quoted 40 lines
Quoted 5 lines
Documentation/filesystems/f2fs.txt extent_cache Enable an extent cache based on rb-tree, it can
Quoted 5 lines
Documentation/filesystems/f2fs.txt +0
-0@@ -144,6 +144,8 @@ extent_cache Enable an extent cache based on rb-tree, it cancache
Quoted 34 lines
Quoted 13 lines
Documentation/filesystems/f2fs.txt +2
-0as many as extent which map between contiguous logical address and physical address per inode, resulting in increasing the cache hit ratio. +noinline_data Disable the inline data feature, inline data feature is + enabled by default. ================================================================================ DEBUGFS ENTRIESfs/f2fs/f2fs.h +0
-0fs/f2fs/f2fs.h line 54
Quoted 4 lines
fs/f2fs/f2fs.h +1
-0@@ -51,6 +51,7 @@#define F2FS_MOUNT_NOBARRIER 0x00000800#define F2FS_MOUNT_FASTBOOT 0x00001000#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 +#define F2FS_MOUNT_NOINLINE_DATA 0x00004000May be we could reuse
F2FS_MOUNT_INLINE_DATAfor saving inline/noinline status likeF2FS_MOUNT_BG_GC.e.g.
parse_options:case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); break;
f2fs_show_options:if (test_opt(sbi, INLINE_DATA)) seq_puts(seq, ",inline_data"); else seq_puts(seq, ",noinline_data");So we can avoid to show both options "inline_data,noinline_data" in ->show_options
Note "show content generated ->show_options", not content in /etc/mtab.
Quoted 4 lines
Quoted 1 line
if we mount with
noinline_data, since this will make our user confused.I didn't see "
inline_data,noinline_data" w/noinline_datamount option, just "rw,noinline_data" dump out.
Try 'cat /proc/mounts'?
Thanks,
Quoted 76 lines
Ping Jaegeuk!
Regards,
Wanpeng LiQuoted 70 lines
How do you think?
Thanks,
Quoted 65 lines
fs/f2fs/f2fs.h +0
-0#define clear_opt (sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)#define set_opt (sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)fs/f2fs/inline.c +1
-1@@ -15,7 +15,7 @@bool f2fs_may_inline (struct inode *inode) { -if (!test_opt (F2FS_I_SB (inode),INLINE_DATA )) +if (!test_opt (F2FS_I_SB (inode),NOINLINE_DATA ))return false;if (f2fs_is_atomic_file (inode))fs/f2fs/super.c +8
-1@@ -58,6 +58,7 @@ enum { Opt_nobarrier, Opt_fastboot, Opt_extent_cache, + Opt_noinline_data, Opt_err, };@@ -80,6 +81,7 @@ static match_table_t f2fs_tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_fastboot, "fastboot"}, {Opt_extent_cache, "extent_cache"}, + {Opt_noinline_data, "noinline_data"}, {Opt_err, NULL}, };@@ -372,6 +374,9 @@ static int parse_options(struct super_block *sb, char *options)case Opt_extent_cache:set_opt (sbi,EXTENT_CACHE );break ; +case Opt_noinline_data: +set_opt (sbi,NOINLINE_DATA ); +break ;default : f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value",@@ -606,6 +611,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",fastboot" );if (test_opt (sbi,EXTENT_CACHE ))seq_puts (seq,",extent_cache" ); +if (test_opt (sbi,NOINLINE_DATA )) +seq_puts (seq,",noinline_data" );seq_printf (seq,",active_logs=%u" , sbi->active_logs);return 0 ;@@ -991,6 +998,7 @@ try_onemore: sbi->active_logs =NR_CURSEG_TYPE ;set_opt (sbi,BG_GC ); +set_opt (sbi,INLINE_DATA );#ifdef CONFIG_F2FS_FS_XATTR set_opt (sbi,XATTR_USER ); --1.9.1
Quoted 16 lines · Chao Yu
Quoted 8 lines
Quoted 8 lines
like
F2FS_MOUNT_BG_GC.e.g.
parse_options:case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); break;Quoted 7 lines
Quoted 7 lines
f2fs_show_options:if (test_opt(sbi, INLINE_DATA)) seq_puts(seq, ",inline_data"); else seq_puts(seq, ",noinline_data");So we can avoid to show both options "inline_data,noinline_data" in ->show_options
Quoted 8 lines
Note "show content generated ->show_options", not content in
/etc/mtab.Quoted 4 lines
Quoted 1 line
if we mount with
noinline_data, since this will make our user confused.I didn't see "
inline_data,noinline_data" w/noinline_datamount option, just "rw,noinline_data" dump out.Try 'cat
/proc/mounts'?
Ah, I just try mount command, and "inline_data, noinline_data" dump out when cat /proc/mounts, I will fix it soon.
Regards,
Wanpeng Li
Quoted 79 lines
Thanks,
Quoted 76 lines
Ping Jaegeuk!
Regards,
Wanpeng LiQuoted 70 lines
How do you think?
Thanks,
Quoted 65 lines
#define
clear_opt(sbi, option)(sbi->mount_opt.opt&= ~F2FS_MOUNT_##option)
#defineset_opt(sbi, option)(sbi->mount_opt.opt|= F2FS_MOUNT_##option)fs/f2fs/inline.c +1
-1@@ -15,7 +15,7 @@bool f2fs_may_inline (struct inode *inode) { -if (!test_opt (F2FS_I_SB (inode),INLINE_DATA )) +if (!test_opt (F2FS_I_SB (inode),NOINLINE_DATA ))return false;if (f2fs_is_atomic_file (inode))fs/f2fs/super.c +8
-1@@ -58,6 +58,7 @@ enum { Opt_nobarrier, Opt_fastboot, Opt_extent_cache, + Opt_noinline_data, Opt_err, };@@ -80,6 +81,7 @@ static match_table_t f2fs_tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_fastboot, "fastboot"}, {Opt_extent_cache, "extent_cache"}, + {Opt_noinline_data, "noinline_data"}, {Opt_err, NULL}, };@@ -372,6 +374,9 @@ static int parse_options(struct super_block *sb, char *options)case Opt_extent_cache:set_opt (sbi,EXTENT_CACHE );break ; +case Opt_noinline_data: +set_opt (sbi,NOINLINE_DATA ); +break ;default : f2fs_msg(sb, KERN_ERR, "Unrecognized mount option \"%s\" or missing value",@@ -606,6 +611,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)seq_puts (seq,",fastboot" );if (test_opt (sbi,EXTENT_CACHE ))seq_puts (seq,",extent_cache" ); +if (test_opt (sbi,NOINLINE_DATA )) +seq_puts (seq,",noinline_data" );seq_printf (seq,",active_logs=%u" , sbi->active_logs);return 0 ;@@ -991,6 +998,7 @@ try_onemore: sbi->active_logs =NR_CURSEG_TYPE ;set_opt (sbi,BG_GC ); +set_opt (sbi,INLINE_DATA );#ifdef CONFIG_F2FS_FS_XATTR set_opt (sbi,XATTR_USER ); --1.9.1