Skip to contentSkip to conversation

vmscan : simplify code

PATCH In review Huang Shijie 3 participants 3 messages Nov 26, 2009 – Dec 6, 2009

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

PATCH 1/1 vmscan : simplify code

simplify the code for shrink_inactive_list.

---
 mm/vmscan.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
mm/vmscan.c +2 -4
index 777af57..0a3cf75 100644
@@ -1166,10 +1166,8 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
 		__mod_zone_page_state(zone, NR_ISOLATED_ANON, nr_anon);
 		__mod_zone_page_state(zone, NR_ISOLATED_FILE, nr_file);
 
-		reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON];
-		reclaim_stat->recent_scanned[0] += count[LRU_ACTIVE_ANON];
-		reclaim_stat->recent_scanned[1] += count[LRU_INACTIVE_FILE];
-		reclaim_stat->recent_scanned[1] += count[LRU_ACTIVE_FILE];
+		reclaim_stat->recent_scanned[0] += nr_anon;
+		reclaim_stat->recent_scanned[1] += nr_file;
 
 		spin_unlock_irq(&zone->lru_lock);
 
Signature · 7 lines
1.6.0.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines

simplify the code for shrink_inactive_list.

---
 mm/vmscan.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
mm/vmscan.c +0 -0
index 777af57..0a3cf75 100644
@@ -1166,10 +1166,8 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
 		__mod_zone_page_state(zone, NR_ISOLATED_ANON, nr_anon);

mm/vmscan.c static unsigned long shrink_inactive_list(unsigned long max_scan, · line 1172

Quoted 10 lines
mm/vmscan.c +2 -4
 		__mod_zone_page_state(zone, NR_ISOLATED_FILE, nr_file);
 
-		reclaim_stat->recent_scanned[0] += count[LRU_INACTIVE_ANON];
-		reclaim_stat->recent_scanned[0] += count[LRU_ACTIVE_ANON];
-		reclaim_stat->recent_scanned[1] += count[LRU_INACTIVE_FILE];
-		reclaim_stat->recent_scanned[1] += count[LRU_ACTIVE_FILE];
+		reclaim_stat->recent_scanned[0] += nr_anon;
+		reclaim_stat->recent_scanned[1] += nr_file;
 
 		spin_unlock_irq(&zone->lru_lock);

Thank you.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>