All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] f2fs: change victim segmap test condition in get_victim_by_default
@ 2013-03-02  3:40 Namjae Jeon
  2013-03-03  4:17 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Namjae Jeon @ 2013-03-02  3:40 UTC (permalink / raw)
  To: jaegeuk.kim
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Namjae Jeon, Amit Sahrawat

From: Namjae Jeon <namjae.jeon@samsung.com>

Instead of checking for victim_segmap(FG_GC) OR
(gc_type == BG_GC) && victim_segmap(BG_GC);
to continue for the victim selection. The 2 conditions
can simply be merged and decision can directly be made using 'gc_type'.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 fs/f2fs/gc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 94b8a0c..16b4148 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -266,10 +266,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
 		}
 		p.offset = ((segno / p.ofs_unit) * p.ofs_unit) + p.ofs_unit;
 
-		if (test_bit(segno, dirty_i->victim_segmap[FG_GC]))
-			continue;
-		if (gc_type == BG_GC &&
-				test_bit(segno, dirty_i->victim_segmap[BG_GC]))
+		if (test_bit(segno, dirty_i->victim_segmap[gc_type]))
 			continue;
 		if (IS_CURSEC(sbi, GET_SECNO(sbi, segno)))
 			continue;
-- 
1.7.9.5


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

* Re: [PATCH 1/5] f2fs: change victim segmap test condition in get_victim_by_default
  2013-03-02  3:40 [PATCH 1/5] f2fs: change victim segmap test condition in get_victim_by_default Namjae Jeon
@ 2013-03-03  4:17 ` Jaegeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2013-03-03  4:17 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Amit Sahrawat

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

2013-03-02 (토), 12:40 +0900, Namjae Jeon:
> From: Namjae Jeon <namjae.jeon@samsung.com>
> 
> Instead of checking for victim_segmap(FG_GC) OR
> (gc_type == BG_GC) && victim_segmap(BG_GC);
> to continue for the victim selection. The 2 conditions
> can simply be merged and decision can directly be made using 'gc_type'.
> 
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
> ---
>  fs/f2fs/gc.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 94b8a0c..16b4148 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -266,10 +266,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
>  		}
>  		p.offset = ((segno / p.ofs_unit) * p.ofs_unit) + p.ofs_unit;
>  
> -		if (test_bit(segno, dirty_i->victim_segmap[FG_GC]))
> -			continue;
> -		if (gc_type == BG_GC &&
> -				test_bit(segno, dirty_i->victim_segmap[BG_GC]))
> +		if (test_bit(segno, dirty_i->victim_segmap[gc_type]))

Negative.
We should check FG_GC all the time.
Thanks,

>  			continue;
>  		if (IS_CURSEC(sbi, GET_SECNO(sbi, segno)))
>  			continue;

-- 
Jaegeuk Kim
Samsung

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-03-03  4:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-02  3:40 [PATCH 1/5] f2fs: change victim segmap test condition in get_victim_by_default Namjae Jeon
2013-03-03  4:17 ` Jaegeuk Kim

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.