So, this patch started out with me trying to keep from passing contiguous, node-specific mem_map into free_area_init_node() and cousins. Instead, I relied on some calls to pfn_to_page(). This works fine and dandy when all you need is the pgdat->node_mem_map to do pfn_to_page(). However, the non-NUMA/DISCONTIG architectures use the real, global mem_map[] instead of a node_mem_map in the pfn_to_page() calculation. So, I ended up effectively trying to initialize mem_map from itself, when it was NULL. That was bad, and caused some very pretty colors on someone's screen when he tested it. So, I had to make sure to initialize the global mem_map[] before calling into free_area_init_node(). Then, I realized how many architectures do this on their own, and have comments like this: /* XXX: MRB-remove - this doesn't seem sane, should this be done somewhere else ?*/ mem_map = NODE_DATA(0)->node_mem_map; Also, ppc64 has some interesting hacks^Wcode in this area to make up for any empty-memory NUMA nodes, which I think can go away now. The following patch does what my first one did (don't pass mem_map into the init functions), incorporates Jesse Barnes' ia64 fixes on top of that, and gets rid of all but one of the global mem_map initializations (parisc is weird). It also magically removes more code than it adds. It could be smaller, but I shamelessly added some comments. arch/alpha/mm/numa.c | 2 - arch/arm/mm/init.c | 6 ---- arch/arm26/mm/init.c | 4 --- arch/cris/arch-v10/mm/init.c | 3 -- arch/i386/mm/discontig.c | 11 +++----- arch/ia64/mm/contig.c | 7 ++--- arch/ia64/mm/discontig.c | 4 +-- arch/ia64/mm/init.c | 8 +++--- arch/mips/sgi-ip27/ip27-memory.c | 2 - arch/parisc/mm/init.c | 2 - arch/ppc64/mm/init.c | 3 -- arch/ppc64/mm/numa.c | 12 --------- arch/sh/mm/init.c | 6 +--- arch/sh64/mm/init.c | 5 --- arch/sparc/mm/srmmu.c | 3 -- arch/sparc/mm/sun4c.c | 3 -- arch/sparc64/mm/init.c | 3 -- arch/v850/kernel/setup.c | 3 -- arch/x86_64/mm/numa.c | 2 - include/asm-ia64/pgtable.h | 2 - include/linux/mm.h | 5 +-- mm/page_alloc.c | 51 +++++++++++++++++++++++++-------------- 22 files changed, 66 insertions(+), 81 deletions(-) -- Dave