linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: mem_init crash for sparsemem
@ 2005-11-04 15:31 Arnd Bergmann
  2005-11-04 20:18 ` Andy Whitcroft
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2005-11-04 15:31 UTC (permalink / raw)
  To: linuxppc64-dev; +Cc: linux-kernel, linux-mm

I have a Cell blade with some broken memory in the middle of the
physical address space and this is correctly detected by the
firmware, but not relocated. When I enable CONFIG_SPARSEMEM,
the memsections for the nonexistant address space do not
get struct page entries allocated, as expected.

However, mem_init for the non-NUMA configuration tries to
access these pages without first looking if they are there.
I'm currently using the hack below to work around that, but
I have the feeling that there should be a cleaner solution
for this.

Please comment.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>

--- linux-2.6.15-rc.orig/arch/powerpc/mm/mem.c
+++ linux-2.6.15-rc/arch/powerpc/mm/mem.c
@@ -348,6 +348,9 @@ void __init mem_init(void)
 #endif
 	for_each_pgdat(pgdat) {
 		for (i = 0; i < pgdat->node_spanned_pages; i++) {
+			if (!section_has_mem_map(__pfn_to_section
+					(pgdat->node_start_pfn + i)))
+				continue;
 			page = pgdat_page_nr(pgdat, i);
 			if (PageReserved(page))
 				reservedpages++;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-04 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-04 15:31 [PATCH] powerpc: mem_init crash for sparsemem Arnd Bergmann
2005-11-04 20:18 ` Andy Whitcroft
2005-11-04 20:57   ` Mike Kravetz
2005-11-04 21:59     ` Arnd Bergmann
2005-11-04 21:43   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox