Index: linux-2.6.17-rc6-cl/include/linux/mmzone.h =================================================================== --- linux-2.6.17-rc6-cl.orig/include/linux/mmzone.h 2006-06-13 14:06:17.452344210 -0700 +++ linux-2.6.17-rc6-cl/include/linux/mmzone.h 2006-06-13 14:06:17.584171965 -0700 @@ -91,9 +91,14 @@ struct per_cpu_pageset { #define ZONE_DMA 0 #define ZONE_DMA32 1 #define ZONE_NORMAL 2 +#ifdef CONFIG_HIGHMEM #define ZONE_HIGHMEM 3 #define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */ +#else +#define MAX_NR_ZONES 3 +#endif + #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ @@ -377,9 +382,14 @@ static inline int populated_zone(struct static inline int is_highmem_idx(int idx) { +#ifdef CONFIG_HIGHMEM return (idx == ZONE_HIGHMEM); +#else + return 0; +#endif } + static inline int is_normal_idx(int idx) { return (idx == ZONE_NORMAL); @@ -393,7 +403,11 @@ static inline int is_normal_idx(int idx) */ static inline int is_highmem(struct zone *zone) { +#ifdef CONFIG_HIGHMEM return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; +#else + return 0; +#endif } static inline int is_normal(struct zone *zone) @@ -425,7 +439,7 @@ struct ctl_table; struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); -extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; +extern int sysctl_lowmem_reserve_ratio[ZONE_NORMAL + 1]; int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, Index: linux-2.6.17-rc6-cl/mm/page_alloc.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/page_alloc.c 2006-06-13 14:06:17.532417365 -0700 +++ linux-2.6.17-rc6-cl/mm/page_alloc.c 2006-06-13 14:06:17.586124968 -0700 @@ -70,7 +70,7 @@ static void __free_pages_ok(struct page * TBD: should special case ZONE_DMA32 machines here - in those we normally * don't need any ZONE_NORMAL reservation */ -int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 }; +int sysctl_lowmem_reserve_ratio[ZONE_NORMAL + 1] = { 256, 256, 32 }; EXPORT_SYMBOL(totalram_pages); @@ -81,7 +81,11 @@ EXPORT_SYMBOL(totalram_pages); struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; EXPORT_SYMBOL(zone_table); -static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" }; +static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal" +#ifdef CONFIG_HIGHMEM +, "HighMem" +#endif +}; int min_free_kbytes = 1024; unsigned long __meminitdata nr_kernel_pages; @@ -1346,8 +1350,13 @@ void si_meminfo_node(struct sysinfo *val val->totalram = pgdat->node_present_pages; val->freeram = nr_free_pages_pgdat(pgdat); +#ifdef CONFIG_HIGHMEM val->totalhigh = pgdat->node_zones[ZONE_HIGHMEM].present_pages; val->freehigh = pgdat->node_zones[ZONE_HIGHMEM].free_pages; +#else + val->totalhigh = 0; + val->freehigh = 0; +#endif val->mem_unit = PAGE_SIZE; } #endif @@ -1474,8 +1483,9 @@ static int __meminit build_zonelists_nod struct zonelist *zonelist, int nr_zones, int zone_type) { struct zone *zone; - +#ifdef CONFIG_HIGHMEM BUG_ON(zone_type > ZONE_HIGHMEM); +#endif do { zone = pgdat->node_zones + zone_type; @@ -1495,8 +1505,10 @@ static int __meminit build_zonelists_nod 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 if (zone_bits & (__force int)__GFP_DMA32) res = ZONE_DMA32; if (zone_bits & (__force int)__GFP_DMA) @@ -2113,7 +2125,9 @@ static void __meminit free_area_init_cor if (zholes_size) realsize -= zholes_size[j]; +#ifdef CONFIG_HIGHMEM if (j < ZONE_HIGHMEM) +#endif nr_kernel_pages += realsize; nr_all_pages += realsize; Index: linux-2.6.17-rc6-cl/mm/swap_prefetch.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/swap_prefetch.c 2006-06-13 14:06:17.414260636 -0700 +++ linux-2.6.17-rc6-cl/mm/swap_prefetch.c 2006-06-13 14:06:17.587101470 -0700 @@ -276,8 +276,11 @@ static void examine_free_limits(void) ns = &sp_stat.node[z->zone_pgdat->node_id]; idx = zone_idx(z); - ns->lowfree[idx] = z->pages_high * 3 + - z->lowmem_reserve[ZONE_HIGHMEM]; + ns->lowfree[idx] = z->pages_high * 3 +#ifdef CONFIG_HIGHMEM + + z->lowmem_reserve[ZONE_HIGHMEM] +#endif +; ns->highfree[idx] = ns->lowfree[idx] + z->pages_high; if (z->free_pages > ns->highfree[idx]) { Index: linux-2.6.17-rc6-cl/include/linux/vmstat.h =================================================================== --- linux-2.6.17-rc6-cl.orig/include/linux/vmstat.h 2006-06-13 14:06:17.529487859 -0700 +++ linux-2.6.17-rc6-cl/include/linux/vmstat.h 2006-06-13 14:06:50.927805452 -0700 @@ -96,7 +96,11 @@ static inline void refresh_vm_stats(void * Counters are handled completely inline. On many platforms the code * generated will simply be the increment of a global address. */ +#ifdef CONFIG_HIGHMEM #define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH +#else +#define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL +#endif enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, FOR_ALL_ZONES(PGALLOC), Index: linux-2.6.17-rc6-cl/mm/vmstat.c =================================================================== --- linux-2.6.17-rc6-cl.orig/mm/vmstat.c 2006-06-13 14:06:17.545111889 -0700 +++ linux-2.6.17-rc6-cl/mm/vmstat.c 2006-06-13 14:23:10.221859523 -0700 @@ -434,7 +434,9 @@ static char *vmstat_text[] = { "pswpin", "pswpout", +#ifdef CONFIG_HIGHMEM "pgalloc_high", +#endif "pgalloc_normal", "pgalloc_dma32", "pgalloc_dma", @@ -446,22 +448,30 @@ static char *vmstat_text[] = { "pgfault", "pgmajfault", +#ifdef CONFIG_HIGHMEM "pgrefill_high", +#endif "pgrefill_normal", "pgrefill_dma32", "pgrefill_dma", +#ifdef CONFIG_HIGHMEM "pgsteal_high", +#endif "pgsteal_normal", "pgsteal_dma32", "pgsteal_dma", +#ifdef CONFIG_HIGHMEM "pgscan_kswapd_high", +#endif "pgscan_kswapd_normal", "pgscan_kswapd_dma32", "pgscan_kswapd_dma", +#ifdef CONFIG_HIGHMEM "pgscan_direct_high", +#endif "pgscan_direct_normal", "pgscan_direct_dma32", "pgscan_direct_dma",