summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-12-29 23:07:53 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2017-01-29 04:46:01 +0100
commit4e6a8d9b224f886362ea6e8f6046b541437c944f (patch)
tree915e62c7bf4ec07d9aa8d84e91515812484b6e58 /fs/f2fs/super.c
parentf2fs: drop exist_data for inline_data when truncated to 0 (diff)
downloadlinux-4e6a8d9b224f886362ea6e8f6046b541437c944f.tar.xz
linux-4e6a8d9b224f886362ea6e8f6046b541437c944f.zip
f2fs: relax async discard commands more
This patch relaxes async discard commands to avoid waiting its end_io during checkpoint. Instead of waiting them during checkpoint, it will be done when actually reusing them. Test on initial partition of nvme drive. # time fstrim /mnt/test Before : 6.158s After : 4.822s Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index b7efbd4f6af9..e68cec492f06 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -770,6 +770,9 @@ static void f2fs_put_super(struct super_block *sb)
write_checkpoint(sbi, &cpc);
}
+ /* be sure to wait for any on-going discard commands */
+ f2fs_wait_discard_bio(sbi, NULL_ADDR);
+
/* write_checkpoint can update stat informaion */
f2fs_destroy_stats(sbi);