@@ -43,14 +43,34 @@ extern void pgdat_page_ext_init(struct pglist_data *pgdat);
static inline void page_ext_init_flatmem(void)
{
}
-extern void page_ext_init(void);
static inline void page_ext_init_flatmem_late(void)
{
}
+extern void _page_ext_init(void);
+#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
+static inline void page_ext_init_early(void)
+{
+}
+static inline void page_ext_init_late(void)
+{
+ _page_ext_init();
+}
+#else
+static inline void page_ext_init_early(void)
+{
+ _page_ext_init();
+}
+static inline void page_ext_init_late(void)
+{
+}
+#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
#else
extern void page_ext_init_flatmem(void);
extern void page_ext_init_flatmem_late(void);
-static inline void page_ext_init(void)
+static inline void page_ext_init_early(void)
+{
+}
+static inline void page_ext_init_late(void)
{
}
#endif
@@ -80,6 +100,10 @@ static inline void page_ext_init(void)
{
}
+static inline void page_ext_init_late(void)
+{
+}
+
static inline void page_ext_init_flatmem_late(void)
{
}
@@ -845,6 +845,7 @@ static void __init mm_init(void)
* slab is ready so that stack_depot_init() works properly
*/
page_ext_init_flatmem_late();
+ page_ext_init_early();
kmemleak_init();
pgtable_init();
debug_objects_mem_init();
@@ -1605,8 +1606,10 @@ static noinline void __init kernel_init_freeable(void)
padata_init();
page_alloc_init_late();
- /* Initialize page ext after all struct pages are initialized. */
- page_ext_init();
+ /* Initialize page ext after all struct pages are initialized if
+ * CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled
+ */
+ page_ext_init_late();
do_basic_setup();
@@ -378,7 +378,7 @@ static int __meminit page_ext_callback(struct notifier_block *self,
return notifier_from_errno(ret);
}
-void __init page_ext_init(void)
+void __init _page_ext_init(void)
{
unsigned long pfn;
int nid;