[PATCH] reduce MAX_NR_ZONES: make ZONE_HIGHMEM optional

Make ZONE_HIGHMEM optional

- ifdef out code and definitions related to CONFIG_HIGHMEM

- __GFP_HIGHMEM falls back to normal allocations if there is no
  ZONE_HIGHMEM

- GFP_ZONEMASK becomes 0x01 if there is no DMA32 and no HIGHMEM
  zone.

[jdike@addtoit.com: build fix]
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Christoph Lameter <clameter@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Christoph Lameter
2006-09-25 23:31:14 -07:00
committed by Linus Torvalds
parent fb0e7942bd
commit e53ef38d05
4 changed files with 51 additions and 11 deletions

View File

@@ -73,7 +73,9 @@ int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = {
#ifdef CONFIG_ZONE_DMA32
256,
#endif
#ifdef CONFIG_HIGHMEM
32
#endif
};
EXPORT_SYMBOL(totalram_pages);
@@ -91,7 +93,9 @@ static char *zone_names[MAX_NR_ZONES] = {
"DMA32",
#endif
"Normal",
#ifdef CONFIG_HIGHMEM
"HighMem"
#endif
};
int min_free_kbytes = 1024;
@@ -1375,8 +1379,10 @@ static int __meminit build_zonelists_node(pg_data_t *pgdat,
static inline int highest_zone(int zone_bits)
{
int res = ZONE_NORMAL;
#ifdef CONFIG_HIGHMEM
if (zone_bits & (__force int)__GFP_HIGHMEM)
res = ZONE_HIGHMEM;
#endif
#ifdef CONFIG_ZONE_DMA32
if (zone_bits & (__force int)__GFP_DMA32)
res = ZONE_DMA32;