All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: avoid unnecessary fg_gc
@ 2017-02-24 10:01 Hou Pengyang
  2017-02-24 10:28 ` Chao Yu
  0 siblings, 1 reply; 15+ messages in thread
From: Hou Pengyang @ 2017-02-24 10:01 UTC (permalink / raw)
  To: jaegeuk, yuchao0; +Cc: guoweichao, linux-f2fs-devel

Under scenerio with large number of dirty nodes, and these nodes are flushed
in SSR mode during cp. enough free segemts now, no need to do fggc.

Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
---
 fs/f2fs/gc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6c996e3..41bdfb7 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -959,7 +959,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
 		 * garbage collections.
 		 */
 		ret = write_checkpoint(sbi, &cpc);
-		if (ret)
+		if (ret || !has_not_enough_free_secs(sbi, sec_freed, 0))
 			goto stop;
 	} else if (gc_type == BG_GC && !background) {
 		/* f2fs_balance_fs doesn't need to do BG_GC in critical path. */
-- 
2.10.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-02-28  2:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-24 10:01 [PATCH] f2fs: avoid unnecessary fg_gc Hou Pengyang
2017-02-24 10:28 ` Chao Yu
2017-02-25  1:44   ` Hou Pengyang
2017-02-25  2:07     ` Chao Yu
2017-02-25  2:07     ` Jaegeuk Kim
2017-02-25  2:23       ` heyunlei
2017-02-25 19:39         ` Jaegeuk Kim
2017-02-27  1:59           ` Hou Pengyang
2017-02-27  2:28             ` heyunlei
2017-02-27 23:40               ` Jaegeuk Kim
2017-02-28  2:06                 ` heyunlei
2017-02-27  6:25           ` Chao Yu
2017-02-25  2:54       ` Hou Pengyang
2017-02-25  3:57       ` [PATCH 1/2] remove stale comment info about cp before fggc Hou Pengyang
2017-02-25  3:57         ` [PATCH 2/2] f2fs: avoid bggc->fggc when enough free segments are avaliable after cp Hou Pengyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.