aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-09-26 02:31:13 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:46 -0400
commit2f1b6248682f8b39ca3c7e549dfc216d26c4109b (patch)
tree2340347d10fd0e564fb8527efe3ffbcb216e1906 /mm/page_alloc.c
parent98d2b0ebda72fc39cdefd3720d50b9b3ce409085 (diff)
[PATCH] reduce MAX_NR_ZONES: use enum to define zones, reformat and comment
Use enum for zones and reformat zones dependent information Add comments explaning the use of zones and add a zones_t type for zone numbers. Line up information that will be #ifdefd by the following patches. [akpm@osdl.org: comment cleanups] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 13c102b95c57..2410a3cb1c53 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -68,7 +68,11 @@ static void __free_pages_ok(struct page *page, unsigned int order);
68 * TBD: should special case ZONE_DMA32 machines here - in those we normally 68 * TBD: should special case ZONE_DMA32 machines here - in those we normally
69 * don't need any ZONE_NORMAL reservation 69 * don't need any ZONE_NORMAL reservation
70 */ 70 */
71int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 }; 71int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = {
72 256,
73 256,
74 32
75};
72 76
73EXPORT_SYMBOL(totalram_pages); 77EXPORT_SYMBOL(totalram_pages);
74 78
@@ -79,7 +83,13 @@ EXPORT_SYMBOL(totalram_pages);
79struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; 83struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly;
80EXPORT_SYMBOL(zone_table); 84EXPORT_SYMBOL(zone_table);
81 85
82static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" }; 86static char *zone_names[MAX_NR_ZONES] = {
87 "DMA",
88 "DMA32",
89 "Normal",
90 "HighMem"
91};
92
83int min_free_kbytes = 1024; 93int min_free_kbytes = 1024;
84 94
85unsigned long __meminitdata nr_kernel_pages; 95unsigned long __meminitdata nr_kernel_pages;
@@ -1487,7 +1497,9 @@ static void __meminit build_zonelists(pg_data_t *pgdat)
1487 1497
1488static void __meminit build_zonelists(pg_data_t *pgdat) 1498static void __meminit build_zonelists(pg_data_t *pgdat)
1489{ 1499{
1490 int i, j, k, node, local_node; 1500 int i, node, local_node;
1501 enum zone_type k;
1502 enum zone_type j;
1491 1503
1492 local_node = pgdat->node_id; 1504 local_node = pgdat->node_id;
1493 for (i = 0; i < GFP_ZONETYPES; i++) { 1505 for (i = 0; i < GFP_ZONETYPES; i++) {
@@ -1675,8 +1687,8 @@ void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
1675} 1687}
1676 1688
1677#define ZONETABLE_INDEX(x, zone_nr) ((x << ZONES_SHIFT) | zone_nr) 1689#define ZONETABLE_INDEX(x, zone_nr) ((x << ZONES_SHIFT) | zone_nr)
1678void zonetable_add(struct zone *zone, int nid, int zid, unsigned long pfn, 1690void zonetable_add(struct zone *zone, int nid, enum zone_type zid,
1679 unsigned long size) 1691 unsigned long pfn, unsigned long size)
1680{ 1692{
1681 unsigned long snum = pfn_to_section_nr(pfn); 1693 unsigned long snum = pfn_to_section_nr(pfn);
1682 unsigned long end = pfn_to_section_nr(pfn + size); 1694 unsigned long end = pfn_to_section_nr(pfn + size);
@@ -1960,7 +1972,7 @@ __meminit int init_currently_empty_zone(struct zone *zone,
1960static void __meminit free_area_init_core(struct pglist_data *pgdat, 1972static void __meminit free_area_init_core(struct pglist_data *pgdat,
1961 unsigned long *zones_size, unsigned long *zholes_size) 1973 unsigned long *zones_size, unsigned long *zholes_size)
1962{ 1974{
1963 unsigned long j; 1975 enum zone_type j;
1964 int nid = pgdat->node_id; 1976 int nid = pgdat->node_id;
1965 unsigned long zone_start_pfn = pgdat->node_start_pfn; 1977 unsigned long zone_start_pfn = pgdat->node_start_pfn;
1966 int ret; 1978 int ret;