Re: [PATCH] don't pass mem_map into init functions

From: Andrew Morton
Date: Wed Aug 04 2004 - 23:47:57 EST


Dave Hansen <haveblue@xxxxxxxxxx> wrote:
>
> 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.

You wanna take a shot at fixing this up please?

arch/sparc64/mm/init.c: In function `paging_init':
arch/sparc64/mm/init.c:1589: warning: passing arg 4 of `free_area_init_node' makes integer from pointer without a cast
arch/sparc64/mm/init.c:1589: warning: passing arg 5 of `free_area_init_node' makes pointer from integer without a cast
arch/sparc64/mm/init.c:1589: error: too many arguments to function `free_area_init_node'

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/