[PATCH 2/6] f2fs: move out f2fs_balance_fs from gc_thread_func

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>

When GC thread is running continously there is no need to call
f2fs_balance_fs unconditinally for garbage collection, instead
the garbage collection will be taken via. calling f2fs_gc in the
thread. So, we can move out the balance out of thread loop and
make it run initially when the thread is started.

Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Signed-off-by: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
---
 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 375e69e..66ac6ad 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -34,6 +34,8 @@ static int gc_thread_func(void *data)
 
 	wait_ms = GC_THREAD_MIN_SLEEP_TIME;
 
+	f2fs_balance_fs(sbi);
+
 	do {
 		if (try_to_freeze())
 			continue;
@@ -49,7 +51,6 @@ static int gc_thread_func(void *data)
 			continue;
 		}
 
-		f2fs_balance_fs(sbi);
 
 		if (!test_opt(sbi, BG_GC))
 			continue;
-- 
1.7.9.5

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux