提交 05f6ed40 编写于 作者: C chenxiangzuo 提交者: Caspar Zhang

alinux: introduce deferred_meminit boot parameter

fix #27418285

We introduce a boot parametter 'deferred_meminit' for defer
page init feature. Default it is disabled, and we can pass
'deferred_meminit' to enable it.
Signed-off-by: Nchenxiangzuo <cxz18821786681@linux.alibaba.com>
Reviewed-by: NXu Yu <xuyu@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NShile Zhang <shile.zhang@linux.alibaba.com>
上级 55952de7
...@@ -818,6 +818,11 @@ ...@@ -818,6 +818,11 @@
Defaults to the default architecture's huge page size Defaults to the default architecture's huge page size
if not specified. 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= deferred_probe_timeout=
[KNL] Debugging option to set a timeout in seconds for [KNL] Debugging option to set a timeout in seconds for
deferred probe to give up waiting on dependencies to deferred probe to give up waiting on dependencies to
......
...@@ -296,6 +296,7 @@ EXPORT_SYMBOL(nr_online_nodes); ...@@ -296,6 +296,7 @@ EXPORT_SYMBOL(nr_online_nodes);
int page_group_by_mobility_disabled __read_mostly; int page_group_by_mobility_disabled __read_mostly;
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT #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 * During boot we initialize deferred pages on-demand, as needed, but once
* page_alloc_init_late() has finished, the deferred pages are all initialized, * 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, ...@@ -341,6 +342,9 @@ static inline bool update_defer_init(pg_data_t *pgdat,
unsigned long pfn, unsigned long zone_end, unsigned long pfn, unsigned long zone_end,
unsigned long *nr_initialised) unsigned long *nr_initialised)
{ {
if (!deferred_mem_init_enabled)
return true;
/* Always populate low zones for address-constrained allocations */ /* Always populate low zones for address-constrained allocations */
if (zone_end < pgdat_end_pfn(pgdat)) if (zone_end < pgdat_end_pfn(pgdat))
return true; return true;
...@@ -353,6 +357,17 @@ static inline bool update_defer_init(pg_data_t *pgdat, ...@@ -353,6 +357,17 @@ static inline bool update_defer_init(pg_data_t *pgdat,
return true; 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 #else
#define kasan_free_nondeferred_pages(p, o) kasan_free_pages(p, o) #define kasan_free_nondeferred_pages(p, o) kasan_free_pages(p, o)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册