aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux-foundation.org>2008-10-18 23:26:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 11:50:25 -0400
commitb69408e88bd86b98feb7b9a38fd865e1ddb29827 (patch)
treeb19277c29fe624870ba776cc6ada59928cd2796d /mm/page_alloc.c
parent62695a84eb8f2e718bf4dfb21700afaa7a08e0ea (diff)
vmscan: Use an indexed array for LRU variables
Currently we are defining explicit variables for the inactive and active list. An indexed array can be more generic and avoid repeating similar code in several places in the reclaim code. We are saving a few bytes in terms of code size: Before: text data bss dec hex filename 4097753 573120 4092484 8763357 85b7dd vmlinux After: text data bss dec hex filename 4097729 573120 4092484 8763333 85b7c5 vmlinux Having an easy way to add new lru lists may ease future work on the reclaim code. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9eb9eb928285..ee7a96ef40dc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3414,6 +3414,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
3414 for (j = 0; j < MAX_NR_ZONES; j++) { 3414 for (j = 0; j < MAX_NR_ZONES; j++) {
3415 struct zone *zone = pgdat->node_zones + j; 3415 struct zone *zone = pgdat->node_zones + j;
3416 unsigned long size, realsize, memmap_pages; 3416 unsigned long size, realsize, memmap_pages;
3417 enum lru_list l;
3417 3418
3418 size = zone_spanned_pages_in_node(nid, j, zones_size); 3419 size = zone_spanned_pages_in_node(nid, j, zones_size);
3419 realsize = size - zone_absent_pages_in_node(nid, j, 3420 realsize = size - zone_absent_pages_in_node(nid, j,
@@ -3465,10 +3466,10 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
3465 zone->prev_priority = DEF_PRIORITY; 3466 zone->prev_priority = DEF_PRIORITY;
3466 3467
3467 zone_pcp_init(zone); 3468 zone_pcp_init(zone);
3468 INIT_LIST_HEAD(&zone->active_list); 3469 for_each_lru(l) {
3469 INIT_LIST_HEAD(&zone->inactive_list); 3470 INIT_LIST_HEAD(&zone->lru[l].list);
3470 zone->nr_scan_active = 0; 3471 zone->lru[l].nr_scan = 0;
3471 zone->nr_scan_inactive = 0; 3472 }
3472 zap_zone_vm_stats(zone); 3473 zap_zone_vm_stats(zone);
3473 zone->flags = 0; 3474 zone->flags = 0;
3474 if (!size) 3475 if (!size)