[RFC/PATCH 2/7] x86, mm: Move zone init from paging_init() on 64-bit

From: Pekka Enberg
Date: Fri Oct 28 2011 - 10:27:55 EST


This patch introduces a zone_sizes_init() helper function on 64-bit to make it
more similar to 32-bit init.

Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
arch/x86/mm/init_64.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index bbaaa00..3ddda59 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -612,7 +612,7 @@ void __init initmem_init(void)
}
#endif

-void __init paging_init(void)
+static void __init zone_sizes_init(void)
{
unsigned long max_zone_pfns[MAX_NR_ZONES];

@@ -623,6 +623,11 @@ void __init paging_init(void)
max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
max_zone_pfns[ZONE_NORMAL] = max_pfn;

+ free_area_init_nodes(max_zone_pfns);
+}
+
+void __init paging_init(void)
+{
sparse_memory_present_with_active_regions(MAX_NUMNODES);
sparse_init();

@@ -634,7 +639,7 @@ void __init paging_init(void)
*/
node_clear_state(0, N_NORMAL_MEMORY);

- free_area_init_nodes(max_zone_pfns);
+ zone_sizes_init();
}

/*
--
1.7.6.4

--
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/