aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2006-10-11 04:20:39 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:14 -0400
commit6391af174ad75f72e92043c1dd8302660a2fec58 (patch)
tree43dfb9a1acfbdabb820180834d4e8efdcfcbe46e /arch/ia64
parent4e0fadfcf62e252d2b14de0e0927eb2830c0c28c (diff)
[PATCH] mm: use symbolic names instead of indices for zone initialisation
Arch-independent zone-sizing is using indices instead of symbolic names to offset within an array related to zones (max_zone_pfns). The unintended impact is that ZONE_DMA and ZONE_NORMAL is initialised on powerpc instead of ZONE_DMA and ZONE_HIGHMEM when CONFIG_HIGHMEM is set. As a result, the the machine fails to boot but will boot with CONFIG_HIGHMEM turned off. The following patch properly initialises the max_zone_pfns[] array and uses symbolic names instead of indices in each architecture using arch-independent zone-sizing. Two users have successfully booted their powerpcs with it (one an ibook G4). It has also been boot tested on x86, x86_64, ppc64 and ia64. Please merge for 2.6.19-rc2. Credit to Benjamin Herrenschmidt for identifying the bug and rolling the first fix. Additional credit to Johannes Berg and Andreas Schwab for reporting the problem and testing on powerpc. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/mm/contig.c1
-rw-r--r--arch/ia64/mm/discontig.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index daf977ff2920..82deaa3a7c48 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -233,6 +233,7 @@ paging_init (void)
233 efi_memmap_walk(count_pages, &num_physpages); 233 efi_memmap_walk(count_pages, &num_physpages);
234 234
235 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; 235 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
236 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
236 max_zone_pfns[ZONE_DMA] = max_dma; 237 max_zone_pfns[ZONE_DMA] = max_dma;
237 max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 238 max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
238 239
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index d497b6b0f5b2..96722cb1b49d 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -709,6 +709,7 @@ void __init paging_init(void)
709 max_pfn = mem_data[node].max_pfn; 709 max_pfn = mem_data[node].max_pfn;
710 } 710 }
711 711
712 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
712 max_zone_pfns[ZONE_DMA] = max_dma; 713 max_zone_pfns[ZONE_DMA] = max_dma;
713 max_zone_pfns[ZONE_NORMAL] = max_pfn; 714 max_zone_pfns[ZONE_NORMAL] = max_pfn;
714 free_area_init_nodes(max_zone_pfns); 715 free_area_init_nodes(max_zone_pfns);