diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index e8004a14247a6a10d9dfc907ee99ffa33c4e84c1..c25bdf4aefe270a97c115b56c57143a2bf30514f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -818,6 +818,11 @@ Defaults to the default architecture's huge page size if not specified. + deferred_meminit + [KNL] When CONFIG_DEFERRED_STRUCT_PAGE_INIT is set, + this parameter enables the deferred page struct + initialization at boot time. In default, it is disabled. + deferred_probe_timeout= [KNL] Debugging option to set a timeout in seconds for deferred probe to give up waiting on dependencies to diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 605a3f926d76ff49c72a6f6be9a02a6d0fbffc87..6f1ebe4f9ea5782458e5ba624f0f26e370e205e7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -296,6 +296,7 @@ EXPORT_SYMBOL(nr_online_nodes); int page_group_by_mobility_disabled __read_mostly; #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT +static bool deferred_mem_init_enabled __meminitdata; /* * During boot we initialize deferred pages on-demand, as needed, but once * page_alloc_init_late() has finished, the deferred pages are all initialized, @@ -341,6 +342,9 @@ static inline bool update_defer_init(pg_data_t *pgdat, unsigned long pfn, unsigned long zone_end, unsigned long *nr_initialised) { + if (!deferred_mem_init_enabled) + return true; + /* Always populate low zones for address-constrained allocations */ if (zone_end < pgdat_end_pfn(pgdat)) return true; @@ -353,6 +357,17 @@ static inline bool update_defer_init(pg_data_t *pgdat, return true; } + +static int __init setup_deferred_mem_init(char *str) +{ + if (!str) + deferred_mem_init_enabled = true; + + return 0; +} + +early_param("deferred_meminit", setup_deferred_mem_init); + #else #define kasan_free_nondeferred_pages(p, o) kasan_free_pages(p, o)