aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2dbdd98426fd..9b43511dbefd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -60,8 +60,11 @@ long nr_swap_pages;
60 * NORMAL allocation will leave 784M/256 of ram reserved in the ZONE_DMA 60 * NORMAL allocation will leave 784M/256 of ram reserved in the ZONE_DMA
61 * HIGHMEM allocation will leave 224M/32 of ram reserved in ZONE_NORMAL 61 * HIGHMEM allocation will leave 224M/32 of ram reserved in ZONE_NORMAL
62 * HIGHMEM allocation will (224M+784M)/256 of ram reserved in ZONE_DMA 62 * HIGHMEM allocation will (224M+784M)/256 of ram reserved in ZONE_DMA
63 *
64 * TBD: should special case ZONE_DMA32 machines here - in those we normally
65 * don't need any ZONE_NORMAL reservation
63 */ 66 */
64int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 32 }; 67int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 };
65 68
66EXPORT_SYMBOL(totalram_pages); 69EXPORT_SYMBOL(totalram_pages);
67EXPORT_SYMBOL(nr_swap_pages); 70EXPORT_SYMBOL(nr_swap_pages);
@@ -73,7 +76,7 @@ EXPORT_SYMBOL(nr_swap_pages);
73struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; 76struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly;
74EXPORT_SYMBOL(zone_table); 77EXPORT_SYMBOL(zone_table);
75 78
76static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" }; 79static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" };
77int min_free_kbytes = 1024; 80int min_free_kbytes = 1024;
78 81
79unsigned long __initdata nr_kernel_pages; 82unsigned long __initdata nr_kernel_pages;
@@ -1442,6 +1445,10 @@ static int __init build_zonelists_node(pg_data_t *pgdat, struct zonelist *zoneli
1442 zone = pgdat->node_zones + ZONE_NORMAL; 1445 zone = pgdat->node_zones + ZONE_NORMAL;
1443 if (zone->present_pages) 1446 if (zone->present_pages)
1444 zonelist->zones[j++] = zone; 1447 zonelist->zones[j++] = zone;
1448 case ZONE_DMA32:
1449 zone = pgdat->node_zones + ZONE_DMA32;
1450 if (zone->present_pages)
1451 zonelist->zones[j++] = zone;
1445 case ZONE_DMA: 1452 case ZONE_DMA:
1446 zone = pgdat->node_zones + ZONE_DMA; 1453 zone = pgdat->node_zones + ZONE_DMA;
1447 if (zone->present_pages) 1454 if (zone->present_pages)
@@ -1456,6 +1463,8 @@ static inline int highest_zone(int zone_bits)
1456 int res = ZONE_NORMAL; 1463 int res = ZONE_NORMAL;
1457 if (zone_bits & (__force int)__GFP_HIGHMEM) 1464 if (zone_bits & (__force int)__GFP_HIGHMEM)
1458 res = ZONE_HIGHMEM; 1465 res = ZONE_HIGHMEM;
1466 if (zone_bits & (__force int)__GFP_DMA32)
1467 res = ZONE_DMA32;
1459 if (zone_bits & (__force int)__GFP_DMA) 1468 if (zone_bits & (__force int)__GFP_DMA)
1460 res = ZONE_DMA; 1469 res = ZONE_DMA;
1461 return res; 1470 return res;
@@ -1976,7 +1985,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
1976 if (zholes_size) 1985 if (zholes_size)
1977 realsize -= zholes_size[j]; 1986 realsize -= zholes_size[j];
1978 1987
1979 if (j == ZONE_DMA || j == ZONE_NORMAL) 1988 if (j < ZONE_HIGHMEM)
1980 nr_kernel_pages += realsize; 1989 nr_kernel_pages += realsize;
1981 nr_all_pages += realsize; 1990 nr_all_pages += realsize;
1982 1991