diff options
-rw-r--r-- | arch/ia64/Kconfig | 9 | ||||
-rw-r--r-- | arch/x86_64/Kconfig | 4 | ||||
-rw-r--r-- | include/linux/gfp.h | 2 | ||||
-rw-r--r-- | include/linux/mmzone.h | 16 | ||||
-rw-r--r-- | include/linux/vmstat.h | 4 | ||||
-rw-r--r-- | mm/page_alloc.c | 6 |
6 files changed, 25 insertions, 16 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index db274da7dba1..f521f2f60a78 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -66,15 +66,6 @@ config IA64_UNCACHED_ALLOCATOR | |||
66 | bool | 66 | bool |
67 | select GENERIC_ALLOCATOR | 67 | select GENERIC_ALLOCATOR |
68 | 68 | ||
69 | config DMA_IS_DMA32 | ||
70 | bool | ||
71 | default y | ||
72 | |||
73 | config DMA_IS_NORMAL | ||
74 | bool | ||
75 | depends on IA64_SGI_SN2 | ||
76 | default y | ||
77 | |||
78 | config AUDIT_ARCH | 69 | config AUDIT_ARCH |
79 | bool | 70 | bool |
80 | default y | 71 | default y |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 6cd4878625f1..581ce9af0ec8 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -24,6 +24,10 @@ config X86 | |||
24 | bool | 24 | bool |
25 | default y | 25 | default y |
26 | 26 | ||
27 | config ZONE_DMA32 | ||
28 | bool | ||
29 | default y | ||
30 | |||
27 | config LOCKDEP_SUPPORT | 31 | config LOCKDEP_SUPPORT |
28 | bool | 32 | bool |
29 | default y | 33 | default y |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index cc9e60844484..14610b56c132 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -13,7 +13,7 @@ struct vm_area_struct; | |||
13 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ | 13 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ |
14 | #define __GFP_DMA ((__force gfp_t)0x01u) | 14 | #define __GFP_DMA ((__force gfp_t)0x01u) |
15 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 15 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
16 | #ifdef CONFIG_DMA_IS_DMA32 | 16 | #ifndef CONFIG_ZONE_DMA32 |
17 | #define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */ | 17 | #define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */ |
18 | #elif BITS_PER_LONG < 64 | 18 | #elif BITS_PER_LONG < 64 |
19 | #define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */ | 19 | #define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 03a5a6eb0ffa..adae3c915938 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -109,12 +109,14 @@ enum zone_type { | |||
109 | * <16M. | 109 | * <16M. |
110 | */ | 110 | */ |
111 | ZONE_DMA, | 111 | ZONE_DMA, |
112 | #ifdef CONFIG_ZONE_DMA32 | ||
112 | /* | 113 | /* |
113 | * x86_64 needs two ZONE_DMAs because it supports devices that are | 114 | * x86_64 needs two ZONE_DMAs because it supports devices that are |
114 | * only able to do DMA to the lower 16M but also 32 bit devices that | 115 | * only able to do DMA to the lower 16M but also 32 bit devices that |
115 | * can only do DMA areas below 4G. | 116 | * can only do DMA areas below 4G. |
116 | */ | 117 | */ |
117 | ZONE_DMA32, | 118 | ZONE_DMA32, |
119 | #endif | ||
118 | /* | 120 | /* |
119 | * Normal addressable memory is in ZONE_NORMAL. DMA operations can be | 121 | * Normal addressable memory is in ZONE_NORMAL. DMA operations can be |
120 | * performed on pages in ZONE_NORMAL if the DMA devices support | 122 | * performed on pages in ZONE_NORMAL if the DMA devices support |
@@ -161,9 +163,13 @@ enum zone_type { | |||
161 | * | 163 | * |
162 | * NOTE! Make sure this matches the zones in <linux/gfp.h> | 164 | * NOTE! Make sure this matches the zones in <linux/gfp.h> |
163 | */ | 165 | */ |
164 | #define GFP_ZONEMASK 0x07 | 166 | #define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ |
165 | /* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ | 167 | |
166 | #define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ | 168 | #ifdef CONFIG_ZONE_DMA32 |
169 | #define GFP_ZONEMASK 0x07 | ||
170 | #else | ||
171 | #define GFP_ZONEMASK 0x03 | ||
172 | #endif | ||
167 | 173 | ||
168 | struct zone { | 174 | struct zone { |
169 | /* Fields commonly accessed by the page allocator */ | 175 | /* Fields commonly accessed by the page allocator */ |
@@ -429,7 +435,11 @@ static inline int is_normal(struct zone *zone) | |||
429 | 435 | ||
430 | static inline int is_dma32(struct zone *zone) | 436 | static inline int is_dma32(struct zone *zone) |
431 | { | 437 | { |
438 | #ifdef CONFIG_ZONE_DMA32 | ||
432 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; | 439 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; |
440 | #else | ||
441 | return 0; | ||
442 | #endif | ||
433 | } | 443 | } |
434 | 444 | ||
435 | static inline int is_dma(struct zone *zone) | 445 | static inline int is_dma(struct zone *zone) |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2d9b1b60798a..9c6e62c56ec2 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -124,12 +124,10 @@ static inline unsigned long node_page_state(int node, | |||
124 | struct zone *zones = NODE_DATA(node)->node_zones; | 124 | struct zone *zones = NODE_DATA(node)->node_zones; |
125 | 125 | ||
126 | return | 126 | return |
127 | #ifndef CONFIG_DMA_IS_NORMAL | 127 | #ifdef CONFIG_ZONE_DMA32 |
128 | #if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64 | ||
129 | zone_page_state(&zones[ZONE_DMA32], item) + | 128 | zone_page_state(&zones[ZONE_DMA32], item) + |
130 | #endif | 129 | #endif |
131 | zone_page_state(&zones[ZONE_NORMAL], item) + | 130 | zone_page_state(&zones[ZONE_NORMAL], item) + |
132 | #endif | ||
133 | #ifdef CONFIG_HIGHMEM | 131 | #ifdef CONFIG_HIGHMEM |
134 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | 132 | zone_page_state(&zones[ZONE_HIGHMEM], item) + |
135 | #endif | 133 | #endif |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2410a3cb1c53..5b5cbb5e1816 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -70,7 +70,9 @@ static void __free_pages_ok(struct page *page, unsigned int order); | |||
70 | */ | 70 | */ |
71 | int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { | 71 | int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { |
72 | 256, | 72 | 256, |
73 | #ifdef CONFIG_ZONE_DMA32 | ||
73 | 256, | 74 | 256, |
75 | #endif | ||
74 | 32 | 76 | 32 |
75 | }; | 77 | }; |
76 | 78 | ||
@@ -85,7 +87,9 @@ EXPORT_SYMBOL(zone_table); | |||
85 | 87 | ||
86 | static char *zone_names[MAX_NR_ZONES] = { | 88 | static char *zone_names[MAX_NR_ZONES] = { |
87 | "DMA", | 89 | "DMA", |
90 | #ifdef CONFIG_ZONE_DMA32 | ||
88 | "DMA32", | 91 | "DMA32", |
92 | #endif | ||
89 | "Normal", | 93 | "Normal", |
90 | "HighMem" | 94 | "HighMem" |
91 | }; | 95 | }; |
@@ -1373,8 +1377,10 @@ static inline int highest_zone(int zone_bits) | |||
1373 | int res = ZONE_NORMAL; | 1377 | int res = ZONE_NORMAL; |
1374 | if (zone_bits & (__force int)__GFP_HIGHMEM) | 1378 | if (zone_bits & (__force int)__GFP_HIGHMEM) |
1375 | res = ZONE_HIGHMEM; | 1379 | res = ZONE_HIGHMEM; |
1380 | #ifdef CONFIG_ZONE_DMA32 | ||
1376 | if (zone_bits & (__force int)__GFP_DMA32) | 1381 | if (zone_bits & (__force int)__GFP_DMA32) |
1377 | res = ZONE_DMA32; | 1382 | res = ZONE_DMA32; |
1383 | #endif | ||
1378 | if (zone_bits & (__force int)__GFP_DMA) | 1384 | if (zone_bits & (__force int)__GFP_DMA) |
1379 | res = ZONE_DMA; | 1385 | res = ZONE_DMA; |
1380 | return res; | 1386 | return res; |