]> www.infradead.org Git - users/jedix/linux-maple.git/commit
page_ext: move up page_ext_init() to catch early page allocation if DEFERRED_STRUCT_P...
authorLi Zhe <lizhe.67@bytedance.com>
Mon, 15 Aug 2022 12:09:54 +0000 (20:09 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 17 Aug 2022 20:58:40 +0000 (13:58 -0700)
commita02a0e703b59a6fdd1b8ae50b47396621a03fc1f
tree448ac0d90e436ac5569e9cf0629ab6e7d1a8874c
parent3be3989b3bb1189c5c36ec50305873ca43abe38d
page_ext: move up page_ext_init() to catch early page allocation if DEFERRED_STRUCT_PAGE_INIT is n

In commit 2f1ee0913ce5 ("Revert "mm: use early_pfn_to_nid in
page_ext_init"") we call page_ext_init() after page_alloc_init_late() to
avoid some panic problem.  It seems that we cannot track early page
allocations in current kernel even if page structure has been initialized
early.

This patch moves up page_ext_init() to catch early page allocations when
DEFERRED_STRUCT_PAGE_INIT is n.  After this patch, we only need to turn
DEFERRED_STRUCT_PAGE_INIT to n then we are able to analyze the early page
allocations.  This is useful especially when we find that the free memory
value is not the same right after different kernel booting.

Link: https://lkml.kernel.org/r/20220815120954.65957-1-lizhe.67@bytedance.com
Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Kees Cook <keescook@chromium.org>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Cc: Qian Cai <cai@lca.pw>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Pasha Tatashin <Pavel.Tatashin@microsoft.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Yang Shi <yang.shi@linaro.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page_ext.h
init/main.c
mm/page_ext.c