pfn_to_nid under CONFIG_SPARSEMEM and CONFIG_NUMA

Mike Kravetz
2005-11-15T22:10:06Z

The following code/comment is in <linux/mmzone.h> if SPARSEMEM
and NUMA are configured.

/*
* These are _only_ used during initialisation, therefore they
* can use __initdata ... They could have names to indicate
* this restriction.
*/
#ifdef CONFIG_NUMA
#define pfn_to_nid early_pfn_to_nid
#endif

However, pfn_to_nid is certainly used in check_pte_range() mm/mempolicy.c.
I wouldn't be surprised to find more non init time uses if you follow all
the call chains.

On ppc64, early_pfn_to_nid now only uses __initdata. So, I would expect
policy code that calls check_pte_range to cause serious problems on ppc64.

Any suggestions on how this should really be structured? I'm thinking
of removing the above definition of pfn_to_nid to force each architecture
to provide a (non init only) version.

--
Mike