aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 22b15a4cde8a..a3803ea8c27d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2994,7 +2994,7 @@ static int __meminit next_active_region_index_in_nid(int index, int nid)
2994 * was used and there are no special requirements, this is a convenient 2994 * was used and there are no special requirements, this is a convenient
2995 * alternative 2995 * alternative
2996 */ 2996 */
2997int __meminit early_pfn_to_nid(unsigned long pfn) 2997int __meminit __early_pfn_to_nid(unsigned long pfn)
2998{ 2998{
2999 int i; 2999 int i;
3000 3000
@@ -3005,10 +3005,33 @@ int __meminit early_pfn_to_nid(unsigned long pfn)
3005 if (start_pfn <= pfn && pfn < end_pfn) 3005 if (start_pfn <= pfn && pfn < end_pfn)
3006 return early_node_map[i].nid; 3006 return early_node_map[i].nid;
3007 } 3007 }
3008 /* This is a memory hole */
3009 return -1;
3010}
3011#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
3012
3013int __meminit early_pfn_to_nid(unsigned long pfn)
3014{
3015 int nid;
3008 3016
3017 nid = __early_pfn_to_nid(pfn);
3018 if (nid >= 0)
3019 return nid;
3020 /* just returns 0 */
3009 return 0; 3021 return 0;
3010} 3022}
3011#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 3023
3024#ifdef CONFIG_NODES_SPAN_OTHER_NODES
3025bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
3026{
3027 int nid;
3028
3029 nid = __early_pfn_to_nid(pfn);
3030 if (nid >= 0 && nid != node)
3031 return false;
3032 return true;
3033}
3034#endif
3012 3035
3013/* Basic iterator support to walk early_node_map[] */ 3036/* Basic iterator support to walk early_node_map[] */
3014#define for_each_active_range_index_in_nid(i, nid) \ 3037#define for_each_active_range_index_in_nid(i, nid) \