Re: [f2fs-dev] [PATCH 3/3] f2fs: export migration_granularity sysfs entry

2018-10-24 Thread Yunlong Song
On 2018/10/24 18:37, Chao Yu wrote: Add one sysfs entry to control migration granularity of GC in large section f2fs, it can be tuned to mitigate heavy overhead of migrating huge number of blocks in large section. Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 9

Re: [f2fs-dev] [PATCH] f2fs: change segment to section in f2fs_ioc_gc_range

2018-10-24 Thread Chao Yu
On 2018/10/24 22:35, Yunlong Song wrote: > f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves > blocks of section each time, so fix it from segment to section. I'm okay with this change, BTW, I notice that I need to change it to use sbi->blocks_per_seg *

Re: [f2fs-dev] [PATCH v2] f2fs: only flush the single temp bio cache which owns the target page

2018-10-24 Thread Chao Yu
On 2018/10/24 19:35, Yunlong Song wrote: > Previously, when f2fs finds which temp bio cache owns the target page, > it will flush all the three temp bio caches, but we only need to flush > one single bio cache indeed, which can help to keep bio merged. > > Signed-off-by: Yunlong Song

Re: [f2fs-dev] [GIT PULL] f2fs update for 4.20-rc1

2018-10-24 Thread Linus Torvalds
On Wed, Oct 24, 2018 at 3:05 AM Jaegeuk Kim wrote: > > git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git > tags/f2fs-for-4.20-rc1 Pulled, Linus ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

[f2fs-dev] [PATCH] f2fs: change segment to section in f2fs_ioc_gc_range

2018-10-24 Thread Yunlong Song
f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves blocks of section each time, so fix it from segment to section. Signed-off-by: Yunlong Song --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[f2fs-dev] [PATCH v2] f2fs: only flush the single temp bio cache which owns the target page

2018-10-24 Thread Yunlong Song
Previously, when f2fs finds which temp bio cache owns the target page, it will flush all the three temp bio caches, but we only need to flush one single bio cache indeed, which can help to keep bio merged. Signed-off-by: Yunlong Song --- fs/f2fs/data.c | 9 +++-- 1 file changed, 7

[f2fs-dev] [PATCH 3/3] f2fs: export migration_granularity sysfs entry

2018-10-24 Thread Chao Yu
Add one sysfs entry to control migration granularity of GC in large section f2fs, it can be tuned to mitigate heavy overhead of migrating huge number of blocks in large section. Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 9 + fs/f2fs/sysfs.c

[f2fs-dev] [PATCH 2/3] f2fs: support subsectional garbage collection

2018-10-24 Thread Chao Yu
Section is minimal garbage collection unit of f2fs, in zoned block device, or ancient block mapping flash device, in order to improve GC efficiency, we can align GC unit to lower device erase unit, normally, it consists of multiple of segments. Once background or foreground GC triggers, it brings

[f2fs-dev] [PATCH 1/3] f2fs: introduce __is_large_section() for cleanup

2018-10-24 Thread Chao Yu
Introduce a wrapper __is_large_section() to clean up codes. Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 2 +- fs/f2fs/f2fs.h| 2 ++ fs/f2fs/file.c| 2 +- fs/f2fs/gc.c | 4 ++-- fs/f2fs/segment.c | 16 fs/f2fs/segment.h | 2 +- 6 files changed, 15

[f2fs-dev] [PATCH] f2fs: clean up f2fs_sb_has_##feature_name

2018-10-24 Thread Chao Yu
In F2FS_HAS_FEATURE(), we will use F2FS_SB(sb) to get sbi pointer to access .raw_super field, to avoid unneeded pointer conversion, this patch changes to F2FS_HAS_FEATURE() accept sbi parameter directly. Just do cleanup, no logic change. Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 2 +-

Re: [f2fs-dev] [PATCH] f2fs: only flush the single temp bio cache which owns the target page

2018-10-24 Thread Chao Yu
Hi Yunlong, On 2018/10/24 16:10, Yunlong Song wrote: > Previously, when f2fs finds which temp bio cache owns the target page, > it will flush all the three temp bio caches, but we only need to flush > one single bio cache indeed, which can help to keep bio merged. > > Signed-off-by: Yunlong Song

Re: [f2fs-dev] [PATCH] f2fs: remove codes of unused wio_mutex

2018-10-24 Thread Chao Yu
On 2018/10/24 16:09, Yunlong Song wrote: > Signed-off-by: Yunlong Song Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v2] f2fs: fix count of seg_freed to make sec_freed correct

2018-10-24 Thread Chao Yu
On 2018/10/24 16:08, Yunlong Song wrote: > When sbi->segs_per_sec > 1, and if some segno has 0 valid blocks before > gc starts, do_garbage_collect will skip counting seg_freed++, and this > will cause seg_freed < sbi->segs_per_sec and finally skip sec_freed++. > > Signed-off-by: Yunlong Song >

[f2fs-dev] [PATCH v2] f2fs: fix to be aware discard/preflush command in is_idle()

2018-10-24 Thread Chao Yu
This patch adds missing in-flight discard/preflush command count check in is_idle(). Signed-off-by: Chao Yu --- v2: - add in-flight preflush count check as well. fs/f2fs/f2fs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index

[f2fs-dev] [PATCH] f2fs: fix to account preflush command for noflush_merge mode

2018-10-24 Thread Chao Yu
Previously, we only account preflush command for flush_merge mode, so for noflush_merge mode, we can not know in-flight preflush command count, fix it. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index

[f2fs-dev] [PATCH] f2fs: only flush the single temp bio cache which owns the target page

2018-10-24 Thread Yunlong Song
Previously, when f2fs finds which temp bio cache owns the target page, it will flush all the three temp bio caches, but we only need to flush one single bio cache indeed, which can help to keep bio merged. Signed-off-by: Yunlong Song --- fs/f2fs/data.c | 13 +++-- 1 file changed, 11

[f2fs-dev] [PATCH] f2fs: remove codes of unused wio_mutex

2018-10-24 Thread Yunlong Song
Signed-off-by: Yunlong Song --- fs/f2fs/f2fs.h | 1 - fs/f2fs/super.c | 5 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 56204a8..4dfa28d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1170,7 +1170,6 @@ struct f2fs_sb_info {

[f2fs-dev] [PATCH v2] f2fs: fix count of seg_freed to make sec_freed correct

2018-10-24 Thread Yunlong Song
When sbi->segs_per_sec > 1, and if some segno has 0 valid blocks before gc starts, do_garbage_collect will skip counting seg_freed++, and this will cause seg_freed < sbi->segs_per_sec and finally skip sec_freed++. Signed-off-by: Yunlong Song Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 7 ---

Re: [f2fs-dev] [PATCH] f2fs: avoid GC causing encrypted file corrupted

2018-10-24 Thread Yunlong Song
ping... On 2018/9/18 20:39, Yunlong Song wrote: The encrypted file may be corrupted by GC in following case: Time 1: | segment 1 blkaddr = A | GC -> | segment 2 blkaddr = B | Encrypted block 1 is moved from blkaddr A of segment 1 to blkaddr B of segment 2, Time 2: | segment 1 blkaddr = B |

[f2fs-dev] [PATCH] f2fs: fix to be aware discard IO in is_idle()

2018-10-24 Thread Chao Yu
This patch adds missing in-flight discard IO count check in is_idle(). Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 6af2a105529d..c8005d271de0 100644 --- a/fs/f2fs/f2fs.h +++