summaryrefslogtreecommitdiff
path: root/init/main.c
diff options
context:
space:
mode:
authorZhenhua Huang <zhenhuah@codeaurora.org>2020-12-15 06:04:46 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 23:13:38 +0300
commit7fb7ab6d618a4dc7ea3f3eafc92388a35b4f8894 (patch)
tree4110f3a14bd7a8b0f8be6a02a5083f37f7aad81a /init/main.c
parent7d18dd75a8afc072aabc77f2a9c3df94cdc53f33 (diff)
downloadlinux-7fb7ab6d618a4dc7ea3f3eafc92388a35b4f8894.tar.xz
mm: fix page_owner initializing issue for arm32
Page owner of pages used by page owner itself used is missing on arm32 targets. The reason is dummy_handle and failure_handle is not initialized correctly. Buddy allocator is used to initialize these two handles. However, buddy allocator is not ready when page owner calls it. This change fixed that by initializing page owner after buddy initialization. The working flow before and after this change are: original logic: 1. allocated memory for page_ext(using memblock). 2. invoke the init callback of page_ext_ops like page_owner(using buddy allocator). 3. initialize buddy. after this change: 1. allocated memory for page_ext(using memblock). 2. initialize buddy. 3. invoke the init callback of page_ext_ops like page_owner(using buddy allocator). with the change, failure/dummy_handle can get its correct value and page owner output for example has the one for page owner itself: Page allocated via order 2, mask 0x6202c0(GFP_USER|__GFP_NOWARN), pid 1006, ts 67278156558 ns PFN 543776 type Unmovable Block 531 type Unmovable Flags 0x0() init_page_owner+0x28/0x2f8 invoke_init_callbacks_flatmem+0x24/0x34 start_kernel+0x33c/0x5d8 Link: https://lkml.kernel.org/r/1603104925-5888-1-git-send-email-zhenhuah@codeaurora.org Signed-off-by: Zhenhua Huang <zhenhuah@codeaurora.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index 32b2a8affafd..82ae0d1345a0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -828,6 +828,8 @@ static void __init mm_init(void)
init_debug_pagealloc();
report_meminit();
mem_init();
+ /* page_owner must be initialized after buddy is ready */
+ page_ext_init_flatmem_late();
kmem_cache_init();
kmemleak_init();
pgtable_init();