diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-09-26 02:31:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:46 -0400 |
commit | 98d2b0ebda72fc39cdefd3720d50b9b3ce409085 (patch) | |
tree | ce51d8a2eab039c25667e6c448d5393582065d14 /mm/page_alloc.c | |
parent | c1f60a5a419cc60aff27daffb150f5a3a3a79ef4 (diff) |
[PATCH] reduce MAX_NR_ZONES: page allocator ZONE_HIGHMEM cleanup
page allocator ZONE_HIGHMEM fixups
1. We do not need to do an #ifdef in si_meminfo since both counters
in use are zero if !CONFIG_HIGHMEM.
2. Add #ifdef in si_meminfo_node instead to avoid referencing zone
information for ZONE_HIGHMEM if we do not have HIGHMEM
(may not be there after the following patches).
3. Replace the use of ZONE_HIGHMEM with MAX_NR_ZONES in build_zonelists_node
4. build_zonelists_node: Remove BUG_ON for ZONE_HIGHMEM. Zone will
be optional soon and thus BUG_ON cannot be triggered anymore.
5. init_free_area_core: Replace a use of ZONE_HIGHMEM with NR_MAX_ZONES.
[akpm@osdl.org: cleanups]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5cde54695cfb..13c102b95c57 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1199,13 +1199,8 @@ void si_meminfo(struct sysinfo *val) | |||
1199 | val->sharedram = 0; | 1199 | val->sharedram = 0; |
1200 | val->freeram = nr_free_pages(); | 1200 | val->freeram = nr_free_pages(); |
1201 | val->bufferram = nr_blockdev_pages(); | 1201 | val->bufferram = nr_blockdev_pages(); |
1202 | #ifdef CONFIG_HIGHMEM | ||
1203 | val->totalhigh = totalhigh_pages; | 1202 | val->totalhigh = totalhigh_pages; |
1204 | val->freehigh = nr_free_highpages(); | 1203 | val->freehigh = nr_free_highpages(); |
1205 | #else | ||
1206 | val->totalhigh = 0; | ||
1207 | val->freehigh = 0; | ||
1208 | #endif | ||
1209 | val->mem_unit = PAGE_SIZE; | 1204 | val->mem_unit = PAGE_SIZE; |
1210 | } | 1205 | } |
1211 | 1206 | ||
@@ -1218,8 +1213,13 @@ void si_meminfo_node(struct sysinfo *val, int nid) | |||
1218 | 1213 | ||
1219 | val->totalram = pgdat->node_present_pages; | 1214 | val->totalram = pgdat->node_present_pages; |
1220 | val->freeram = nr_free_pages_pgdat(pgdat); | 1215 | val->freeram = nr_free_pages_pgdat(pgdat); |
1216 | #ifdef CONFIG_HIGHMEM | ||
1221 | val->totalhigh = pgdat->node_zones[ZONE_HIGHMEM].present_pages; | 1217 | val->totalhigh = pgdat->node_zones[ZONE_HIGHMEM].present_pages; |
1222 | val->freehigh = pgdat->node_zones[ZONE_HIGHMEM].free_pages; | 1218 | val->freehigh = pgdat->node_zones[ZONE_HIGHMEM].free_pages; |
1219 | #else | ||
1220 | val->totalhigh = 0; | ||
1221 | val->freehigh = 0; | ||
1222 | #endif | ||
1223 | val->mem_unit = PAGE_SIZE; | 1223 | val->mem_unit = PAGE_SIZE; |
1224 | } | 1224 | } |
1225 | #endif | 1225 | #endif |
@@ -1344,14 +1344,11 @@ static int __meminit build_zonelists_node(pg_data_t *pgdat, | |||
1344 | { | 1344 | { |
1345 | struct zone *zone; | 1345 | struct zone *zone; |
1346 | 1346 | ||
1347 | BUG_ON(zone_type > ZONE_HIGHMEM); | 1347 | BUG_ON(zone_type >= MAX_NR_ZONES); |
1348 | 1348 | ||
1349 | do { | 1349 | do { |
1350 | zone = pgdat->node_zones + zone_type; | 1350 | zone = pgdat->node_zones + zone_type; |
1351 | if (populated_zone(zone)) { | 1351 | if (populated_zone(zone)) { |
1352 | #ifndef CONFIG_HIGHMEM | ||
1353 | BUG_ON(zone_type > ZONE_NORMAL); | ||
1354 | #endif | ||
1355 | zonelist->zones[nr_zones++] = zone; | 1352 | zonelist->zones[nr_zones++] = zone; |
1356 | check_highest_zone(zone_type); | 1353 | check_highest_zone(zone_type); |
1357 | } | 1354 | } |
@@ -1981,7 +1978,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat, | |||
1981 | if (zholes_size) | 1978 | if (zholes_size) |
1982 | realsize -= zholes_size[j]; | 1979 | realsize -= zholes_size[j]; |
1983 | 1980 | ||
1984 | if (j < ZONE_HIGHMEM) | 1981 | if (!is_highmem_idx(j)) |
1985 | nr_kernel_pages += realsize; | 1982 | nr_kernel_pages += realsize; |
1986 | nr_all_pages += realsize; | 1983 | nr_all_pages += realsize; |
1987 | 1984 | ||