diff options
author | Mel Gorman <mel@csn.ul.ie> | 2006-10-11 04:20:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:14 -0400 |
commit | 6391af174ad75f72e92043c1dd8302660a2fec58 (patch) | |
tree | 43dfb9a1acfbdabb820180834d4e8efdcfcbe46e /arch/powerpc | |
parent | 4e0fadfcf62e252d2b14de0e0927eb2830c0c28c (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/powerpc')
-rw-r--r-- | arch/powerpc/mm/mem.c | 7 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 16fe027bbc12..d1c0758c5611 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -307,11 +307,12 @@ void __init paging_init(void) | |||
307 | top_of_ram, total_ram); | 307 | top_of_ram, total_ram); |
308 | printk(KERN_DEBUG "Memory hole size: %ldMB\n", | 308 | printk(KERN_DEBUG "Memory hole size: %ldMB\n", |
309 | (top_of_ram - total_ram) >> 20); | 309 | (top_of_ram - total_ram) >> 20); |
310 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | ||
310 | #ifdef CONFIG_HIGHMEM | 311 | #ifdef CONFIG_HIGHMEM |
311 | max_zone_pfns[0] = total_lowmem >> PAGE_SHIFT; | 312 | max_zone_pfns[ZONE_DMA] = total_lowmem >> PAGE_SHIFT; |
312 | max_zone_pfns[1] = top_of_ram >> PAGE_SHIFT; | 313 | max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT; |
313 | #else | 314 | #else |
314 | max_zone_pfns[0] = top_of_ram >> PAGE_SHIFT; | 315 | max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT; |
315 | #endif | 316 | #endif |
316 | free_area_init_nodes(max_zone_pfns); | 317 | free_area_init_nodes(max_zone_pfns); |
317 | } | 318 | } |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 43c272075e1a..9da01dc8cfd9 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -617,9 +617,9 @@ void __init do_init_bootmem(void) | |||
617 | 617 | ||
618 | void __init paging_init(void) | 618 | void __init paging_init(void) |
619 | { | 619 | { |
620 | unsigned long max_zone_pfns[MAX_NR_ZONES] = { | 620 | unsigned long max_zone_pfns[MAX_NR_ZONES]; |
621 | lmb_end_of_DRAM() >> PAGE_SHIFT | 621 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |
622 | }; | 622 | max_zone_pfns[ZONE_DMA] = lmb_end_of_DRAM() >> PAGE_SHIFT; |
623 | free_area_init_nodes(max_zone_pfns); | 623 | free_area_init_nodes(max_zone_pfns); |
624 | } | 624 | } |
625 | 625 | ||