All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: should get a victim from retrials
@ 2015-09-21 19:12 ` Jaegeuk Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2015-09-21 19:12 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

If we do not call get_victim first, we cannot get a new victim for retrial
path.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 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 782b8e7..e932740 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -823,7 +823,8 @@ gc_more:
 			write_checkpoint(sbi, &cpc);
 	}
 
-	if (segno == NULL_SEGNO && !__get_victim(sbi, &segno, gc_type))
+	/* should call __get_victim first to get a victim from retrial path */
+	if (!__get_victim(sbi, &segno, gc_type) && segno == NULL_SEGNO)
 		goto stop;
 	ret = 0;
 
-- 
2.1.1


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

* [PATCH] f2fs: should get a victim from retrials
@ 2015-09-21 19:12 ` Jaegeuk Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2015-09-21 19:12 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

If we do not call get_victim first, we cannot get a new victim for retrial
path.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 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 782b8e7..e932740 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -823,7 +823,8 @@ gc_more:
 			write_checkpoint(sbi, &cpc);
 	}
 
-	if (segno == NULL_SEGNO && !__get_victim(sbi, &segno, gc_type))
+	/* should call __get_victim first to get a victim from retrial path */
+	if (!__get_victim(sbi, &segno, gc_type) && segno == NULL_SEGNO)
 		goto stop;
 	ret = 0;
 
-- 
2.1.1


------------------------------------------------------------------------------

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

* Re: [PATCH v2] f2fs: should get a victim from retrials
  2015-09-21 19:12 ` Jaegeuk Kim
  (?)
@ 2015-09-28 21:43 ` Jaegeuk Kim
  2015-09-30  9:00     ` Chao Yu
  -1 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2015-09-28 21:43 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel

Change log from v1:
 o avoid __get_victim call twice, since each call registers the victim in bitmap

>From 45c3aaea805751e5c1899dd9c76d89e6f73a7a8f Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Fri, 18 Sep 2015 17:33:00 -0700
Subject: [PATCH] f2fs: should get a victim from retrials

If we do not call get_victim first, we cannot get a new victim for retrial
path.

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

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b6e03eb..343b096 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -799,8 +799,7 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, unsigned int segno,
 
 int f2fs_gc(struct f2fs_sb_info *sbi)
 {
-	unsigned int segno = NULL_SEGNO;
-	unsigned int i;
+	unsigned int segno, i;
 	int gc_type = BG_GC;
 	int sec_freed = 0;
 	int ret = -1;
@@ -812,6 +811,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
 
 	cpc.reason = __get_cp_reason(sbi);
 gc_more:
+	segno = NULL_SEGNO;
+
 	if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE)))
 		goto stop;
 	if (unlikely(f2fs_cp_error(sbi)))
-- 
2.1.1


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

* RE: [f2fs-dev] [PATCH v2] f2fs: should get a victim from retrials
  2015-09-28 21:43 ` [PATCH v2] " Jaegeuk Kim
@ 2015-09-30  9:00     ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2015-09-30  9:00 UTC (permalink / raw)
  To: 'Jaegeuk Kim', linux-kernel, linux-fsdevel, linux-f2fs-devel

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Tuesday, September 29, 2015 5:44 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH v2] f2fs: should get a victim from retrials
> 
> Change log from v1:
>  o avoid __get_victim call twice, since each call registers the victim in bitmap
> 
> >From 45c3aaea805751e5c1899dd9c76d89e6f73a7a8f Mon Sep 17 00:00:00 2001
> From: Jaegeuk Kim <jaegeuk@kernel.org>
> Date: Fri, 18 Sep 2015 17:33:00 -0700
> Subject: [PATCH] f2fs: should get a victim from retrials
> 
> If we do not call get_victim first, we cannot get a new victim for retrial
> path.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


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

* Re: [PATCH v2] f2fs: should get a victim from retrials
@ 2015-09-30  9:00     ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2015-09-30  9:00 UTC (permalink / raw)
  To: 'Jaegeuk Kim', linux-kernel, linux-fsdevel, linux-f2fs-devel

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Tuesday, September 29, 2015 5:44 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH v2] f2fs: should get a victim from retrials
> 
> Change log from v1:
>  o avoid __get_victim call twice, since each call registers the victim in bitmap
> 
> >From 45c3aaea805751e5c1899dd9c76d89e6f73a7a8f Mon Sep 17 00:00:00 2001
> From: Jaegeuk Kim <jaegeuk@kernel.org>
> Date: Fri, 18 Sep 2015 17:33:00 -0700
> Subject: [PATCH] f2fs: should get a victim from retrials
> 
> If we do not call get_victim first, we cannot get a new victim for retrial
> path.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


------------------------------------------------------------------------------

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

end of thread, other threads:[~2015-09-30  9:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 19:12 [PATCH] f2fs: should get a victim from retrials Jaegeuk Kim
2015-09-21 19:12 ` Jaegeuk Kim
2015-09-28 21:43 ` [PATCH v2] " Jaegeuk Kim
2015-09-30  9:00   ` [f2fs-dev] " Chao Yu
2015-09-30  9:00     ` Chao Yu

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.