When using CONFIG_NONLINEAR, a zone's mem_map isn't contiguous, and isn't
allocated in the same place. This means that nonlinear doesn't really have
a mem_map[] to pass into free_area_init_node() or memmap_init_zone() which
makes any sense.
So, this patch removes the 'struct page *mem_map' argument to both of
those functions. All non-NUMA architectures just pass a NULL in there,
which is ignored. The solution on the NUMA arches is to pass the mem_map in
via the pgdat, which works just fine.
To replace the removed arguments, a call to pfn_to_page(node_start_pfn) is
made. This is valid because all of the pfn_to_page() implementations rely
only on the pgdats, which are already set up at this time. Plus, the
pfn_to_page() method should work for any future nonlinear-type code.
Finally, the patch creates a function: node_alloc_mem_map(), which I plan
to effectively #ifdef out for nonlinear at some future date.
Compile tested and booted on SMP x86, NUMAQ, and ppc64.
From: Jesse Barnes <jbarnes@engr.sgi.com>
Fix up ia64 specific memory map init function in light of Dave's
memmap_init cleanups.
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
From: Dave Hansen <haveblue@us.ibm.com>
Looks like I missed a couple of architectures. This patch, on top of my
previous one and Jesse's should clean up the rest.
From: William Lee Irwin III <wli@holomorphy.com>
x86-64 wouldn't compile with NUMA support on, as node_alloc_mem_map()
references mem_map outside #ifdefs on CONFIG_NUMA/CONFIG_DISCONTIGMEM. This
patch wraps that reference in such an #ifdef.
From: William Lee Irwin III <wli@holomorphy.com>
Initializing NODE_DATA(nid)->node_mem_map prior to calling it should do.
From: Dave Hansen <haveblue@us.ibm.com>
Rick, I bet you didn't think your nerf weapons would be so effective in
getting that compile error fixed, did you?
Applying the attached patch and commenting out this line:
arch/i386/kernel/nmi.c: In function `proc_unknown_nmi_panic':
arch/i386/kernel/nmi.c:558: too few arguments to function `proc_dointvec'
will let it compile.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>