f2fs: skip ->writepages for {mete,node}_inode during recovery
Chao Yu
maintainerPATCH 1/2 f2fs: skip ->writepages for {mete,node}_inode during recovery
From: Chao Yu <[email protected]>
Skip ->writepages in prior to ->writepage for {meta,node}_inode during recovery, hence unneeded loop in ->writepages can be avoided.
Moreover, check SBI_POR_DOING earlier while writebacking pages.
--- fs/f2fs/checkpoint.c | 3 +++ fs/f2fs/data.c | 13 +++++++------ fs/f2fs/node.c | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-)
fs/f2fs/checkpoint.c +3 -0
@@ -269,6 +269,9 @@ static int f2fs_write_meta_pages(struct address_space *mapping,struct f2fs_sb_info *sbi =F2FS_M_SB (mapping);long diff, written; +if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) + goto skip_write; +/* collect a number of dirty meta pages and write together */ if (wbc->for_kupdate ||get_pages (sbi,F2FS_DIRTY_META ) <nr_pages_to_skip (sbi,META ))
fs/f2fs/data.c +7 -6
@@ -1493,6 +1493,9 @@ static int __write_data_page(struct page *page, bool *submitted,trace_f2fs_writepage (page,DATA ); +if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) + goto redirty_out; +if (page->index < end_index) goto write;
@@ -1506,8 +1509,6 @@ static int __write_data_page(struct page *page, bool *submitted,zero_user_segment (page, offset,PAGE_SIZE ); write: -if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) - goto redirty_out;if (f2fs_is_drop_cache (inode)) goto out;/* we should not write 0'th page having journal header */
@@ -1755,6 +1756,10 @@ static int f2fs_write_data_pages(struct address_space *mapping,if (!get_dirty_pages (inode) && wbc->sync_mode ==WB_SYNC_NONE )return 0 ; +/* during POR, we don't need to trigger writepage at all. */ +if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) + goto skip_write; +if (S_ISDIR (inode->i_mode) && wbc->sync_mode ==WB_SYNC_NONE &&get_dirty_pages (inode) <nr_pages_to_skip (sbi,DATA ) &&available_free_memory (sbi,DIRTY_DENTS ))
@@ -1764,10 +1769,6 @@ static int f2fs_write_data_pages(struct address_space *mapping,if (is_inode_flag_set (inode,FI_DO_DEFRAG )) goto skip_write; -/* during POR, we don't need to trigger writepage at all. */ -if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) - goto skip_write; -trace_f2fs_writepages (mapping->host, wbc,DATA );/* to avoid spliting IOs due to mixed WB_SYNC_ALL and WB_SYNC_NONE */
fs/f2fs/node.c +3 -0
@@ -1687,6 +1687,9 @@ static int f2fs_write_node_pages(struct address_space *mapping,struct blk_plug plug;long diff; +if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) + goto skip_write; +/* balancing f2fs's metadata in background */ f2fs_balance_fs_bg (sbi);
Signature · 6 lines
2.13.0.90.g1eb437020 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Chao Yu
maintainerPATCH 2/2 f2fs: reuse original mount option in ->remount_fs
From: Chao Yu <[email protected]>
Don't clear old mount option before parse new option during ->remount_fs like other generic filesystems.
--- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-)
fs/f2fs/super.c +0 -1
@@ -846,7 +846,6 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)clear_sbi_flag (sbi,SBI_NEED_SB_WRITE ); } - sbi->mount_opt.opt =0 ;default_options (sbi);/* parse mount options */
Signature · 6 lines
2.13.0.90.g1eb437020 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jaegeuk Kim
maintainerRe: [PATCH 2/2] f2fs: reuse original mount option in ->remount_fs
Quoted 4 lines · Chao Yu
From: Chao Yu <[email protected]>
Don't clear old mount option before parse new option during ->remount_fs like other generic filesystems.
So, what happened on your original patch?
commit 26666c8a4366debae30ae37d0688b2bec92d196a
f2fs: fix to clean previous mount option when remount_fs
I think we need to rever the original patch tho.
Thanks,
Quoted 20 lines
Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-)fs/f2fs/super.c +0
-1@@ -846,7 +846,6 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)clear_sbi_flag (sbi,SBI_NEED_SB_WRITE ); } - sbi->mount_opt.opt =0 ;default_options (sbi);/* parse mount options */ Signature · 1 line
2.13.0.90.g1eb437020
Chao Yu
maintainerRe: [PATCH 2/2] f2fs: reuse original mount option in ->remount_fs
Quoted 11 lines · Jaegeuk Kim
Quoted 4 lines · Chao Yu
From: Chao Yu <[email protected]>
Don't clear old mount option before parse new option during ->remount_fs like other generic filesystems>
So, what happened on your original patch?
commit
26666c8a4366debae30ae37d0688b2bec92d196a
f2fs: fix to clean previous mount option whenremount_fsI think we need to rever the original patch tho.
I just removed this for passing some quota testcases in xfstests suit, and after that, I didn't get further failures in other testcases.
Let me check this again.
Thanks,
Quoted 23 lines
Thanks,
Quoted 20 lines
Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-)fs/f2fs/super.c +0
-1@@ -846,7 +846,6 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)clear_sbi_flag (sbi,SBI_NEED_SB_WRITE ); } - sbi->mount_opt.opt =0 ;default_options (sbi);/* parse mount options */ Signature · 1 line
2.13.0.90.g1eb437020
Chao Yu
maintainerRe: [PATCH 2/2] f2fs: reuse original mount option in ->remount_fs
In reply to Jaegeuk KimQuoted 10 lines · Jaegeuk Kim
Quoted 4 lines · Chao Yu
From: Chao Yu <[email protected]>
Don't clear old mount option before parse new option during ->remount_fs like other generic filesystems.
So, what happened on your original patch?
commit
26666c8a4366debae30ae37d0688b2bec92d196a
f2fs: fix to clean previous mount option whenremount_fs
I think that patch is wrong, since the manual doesn't describe kernel logic, so I'd like revert that patch, then f2fs ->remount_fs logic is more like generic filesystem.
Thanks,
Quoted 24 lines
I think we need to rever the original patch tho.>
Thanks,Quoted 20 lines
Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-)fs/f2fs/super.c +0
-1@@ -846,7 +846,6 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)clear_sbi_flag (sbi,SBI_NEED_SB_WRITE ); } - sbi->mount_opt.opt =0 ;default_options (sbi);/* parse mount options */ Signature · 1 line
2.13.0.90.g1eb437020