Index: linux-2.6.17-rc6-cl/arch/ia64/mm/discontig.c =================================================================== --- linux-2.6.17-rc6-cl.orig/arch/ia64/mm/discontig.c 2006-06-12 12:42:41.853008907 -0700 +++ linux-2.6.17-rc6-cl/arch/ia64/mm/discontig.c 2006-06-13 14:06:56.119865998 -0700 @@ -752,12 +752,16 @@ void __init paging_init(void) num_physpages += mem_data[node].num_physpages; if (mem_data[node].min_pfn >= max_dma) { +#ifdef CONFIG_DMA_IS_NORMAL + BUG(); +#else /* All of this node's memory is above ZONE_DMA */ zones_size[ZONE_NORMAL] = mem_data[node].max_pfn - mem_data[node].min_pfn; zholes_size[ZONE_NORMAL] = mem_data[node].max_pfn - mem_data[node].min_pfn - mem_data[node].num_physpages; +#endif } else if (mem_data[node].max_pfn < max_dma) { /* All of this node's memory is in ZONE_DMA */ zones_size[ZONE_DMA] = mem_data[node].max_pfn - @@ -766,6 +770,9 @@ void __init paging_init(void) mem_data[node].min_pfn - mem_data[node].num_dma_physpages; } else { +#ifdef CONFIG_DMA_IS_NORMAL + BUG(); +#else /* This node has memory in both zones */ zones_size[ZONE_DMA] = max_dma - mem_data[node].min_pfn; @@ -776,6 +783,7 @@ void __init paging_init(void) zholes_size[ZONE_NORMAL] = zones_size[ZONE_NORMAL] - (mem_data[node].num_physpages - mem_data[node].num_dma_physpages); +#endif } pfn_offset = mem_data[node].min_pfn; 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.586124968 -0700 +++ linux-2.6.17-rc6-cl/mm/page_alloc.c 2006-06-13 14:09:18.382520624 -0700 @@ -70,7 +70,11 @@ 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[ZONE_NORMAL + 1] = { 256, 256, 32 }; +int sysctl_lowmem_reserve_ratio[NR_REGULAR_ZONES] = { 256 +#ifndef CONFIG_DMA_IS_NORMAL +, 256, 32 +#endif +}; EXPORT_SYMBOL(totalram_pages); @@ -81,10 +85,13 @@ 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" +static char *zone_names[MAX_NR_ZONES] = { "DMA" +#ifndef CONFIG_DMA_IS_NORMAL +, "DMA32", "Normal" #ifdef CONFIG_HIGHMEM , "HighMem" #endif +#endif }; int min_free_kbytes = 1024; @@ -1491,7 +1498,7 @@ static int __meminit build_zonelists_nod zone = pgdat->node_zones + zone_type; if (populated_zone(zone)) { #ifndef CONFIG_HIGHMEM - BUG_ON(zone_type > ZONE_NORMAL); + BUG_ON(zone_type >= NR_REGULAR_ZONES); #endif zonelist->zones[nr_zones++] = zone; check_highest_zone(zone_type); @@ -1501,7 +1508,9 @@ static int __meminit build_zonelists_nod } while (zone_type >= 0); return nr_zones; } - +#ifdef CONFIG_DMA_IS_NORMAL +#define highest_zone(yy) 0 +#else static inline int highest_zone(int zone_bits) { int res = ZONE_NORMAL; @@ -1515,6 +1524,7 @@ static inline int highest_zone(int zone_ res = ZONE_DMA; return res; } +#endif #ifdef CONFIG_NUMA #define MAX_NODE_LOAD (num_online_nodes()) 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.584171965 -0700 +++ linux-2.6.17-rc6-cl/include/linux/mmzone.h 2006-06-13 14:06:56.122795503 -0700 @@ -89,8 +89,10 @@ struct per_cpu_pageset { #endif #define ZONE_DMA 0 +#ifndef CONFIG_DMA_IS_NORMAL #define ZONE_DMA32 1 #define ZONE_NORMAL 2 +#define NR_REGULAR_ZONES 3 #ifdef CONFIG_HIGHMEM #define ZONE_HIGHMEM 3 @@ -100,7 +102,11 @@ struct per_cpu_pageset { #endif #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ - +#else +#define MAX_NR_ZONES 1 +#define NR_REGULAR_ZONES 1 +#define ZONES_SHIFT 0 +#endif /* * When a memory allocation must conform to specific limitations (such @@ -373,7 +379,11 @@ unsigned long __init node_memmap_size_by /* * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc. */ +#ifdef CONFIG_DMA_IS_NORMAL +#define zone_idx(zone) 0 +#else #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) +#endif static inline int populated_zone(struct zone *zone) { @@ -392,7 +402,11 @@ static inline int is_highmem_idx(int idx static inline int is_normal_idx(int idx) { +#ifdef CONFIG_DMA_IS_NORMAL + return 0; +#else return (idx == ZONE_NORMAL); +#endif } /** @@ -412,17 +426,29 @@ static inline int is_highmem(struct zone static inline int is_normal(struct zone *zone) { +#ifdef CONFIG_DMA_IS_NORMAL + return 0; +#else return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; +#endif } static inline int is_dma32(struct zone *zone) { +#ifdef CONFIG_DMA_IS_NORMAL + return 0; +#else return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; +#endif } static inline int is_dma(struct zone *zone) { +#ifdef CONFIG_DMA_IS_NORMAL + return 1; +#else return zone == zone->zone_pgdat->node_zones + ZONE_DMA; +#endif } static inline unsigned long zone_boundary_align_pfn(unsigned long pfn) @@ -439,7 +465,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[ZONE_NORMAL + 1]; +extern int sysctl_lowmem_reserve_ratio[NR_REGULAR_ZONES]; 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/drivers/char/sysrq.c =================================================================== --- linux-2.6.17-rc6-cl.orig/drivers/char/sysrq.c 2006-06-12 12:42:42.900795630 -0700 +++ linux-2.6.17-rc6-cl/drivers/char/sysrq.c 2006-06-13 14:06:56.123772005 -0700 @@ -230,7 +230,7 @@ static struct sysrq_key_op sysrq_term_op static void moom_callback(void *ignored) { - out_of_memory(&NODE_DATA(0)->node_zonelists[ZONE_NORMAL], + out_of_memory(&NODE_DATA(0)->node_zonelists[ZONE_DMA], GFP_KERNEL, 0); } 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:50.927805452 -0700 +++ linux-2.6.17-rc6-cl/include/linux/vmstat.h 2006-06-13 14:08:43.486248947 -0700 @@ -96,11 +96,15 @@ 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_DMA_IS_NORMAL +#define FOR_ALL_ZONES(x) x##_DMA +#else #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 +#endif enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, FOR_ALL_ZONES(PGALLOC),