[PATCH] f2fs: skip checkpoint if there is no dirty and prefree segments

From: Jaegeuk Kim
Date: Wed Aug 12 2015 - 00:59:49 EST


We should avoid needless checkpoints when there is no dirty and prefree segment.

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
fs/f2fs/gc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..98bf538 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -811,7 +811,8 @@ gc_more:

if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
gc_type = FG_GC;
- write_checkpoint(sbi, &cpc);
+ if (dirty_segments(sbi) || prefree_segments(sbi))
+ write_checkpoint(sbi, &cpc);
}

if (!__get_victim(sbi, &segno, gc_type))
--
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/