Skip to contentSkip to conversation

f2fs: change victim segmap test condition in get_victim_by_default

PATCH In review Namjae Jeon 2 participants 2 messages Mar 2, 2013 – Mar 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 f2fs: change victim segmap test condition in get_victim_by_default

From: Namjae Jeon <[email protected]>

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'.

---
 fs/f2fs/gc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/f2fs/gc.c +1 -4
index 94b8a0c..16b4148 100644
@@ -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;
Signature · 1 line
1.7.9.5
#1 lore raw

2013-03-02 (토), 12:40 +0900, Namjae Jeon:

Quoted 18 lines

From: Namjae Jeon <[email protected]>

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'.

---
 fs/f2fs/gc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/f2fs/gc.c +0 -0
index 94b8a0c..16b4148 100644

fs/f2fs/gc.c static int get_victim_by_default(struct f2fs_sb_info *sbi, · line 269

Quoted 8 lines
fs/f2fs/gc.c +1 -4
@@ -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,

Quoted 3 lines
fs/f2fs/gc.c +0 -0
 			continue;
 		if (IS_CURSEC(sbi, GET_SECNO(sbi, segno)))
 			continue;
Signature · 2 lines
Jaegeuk Kim
Samsung