lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220829081837.38225-1-lizhe.67@bytedance.com>
Date:   Mon, 29 Aug 2022 16:18:37 +0800
From:   lizhe.67@...edance.com
To:     vbabka@...e.cz
Cc:     Jason@...c4.com, akpm@...ux-foundation.org, corbet@....net,
        keescook@...omium.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        lizefan.x@...edance.com, lizhe.67@...edance.com,
        mark-pk.tsai@...iatek.com, mhiramat@...nel.org, mhocko@...e.com,
        rostedt@...dmis.org
Subject: Re: [PATCH v4] page_ext: introduce boot parameter 'early_page_ext'

On 26 Aug 2022 12:49:25 +0200, vbabka@...e.cz wrote:
>On 8/26/22 06:23, Andrew Morton wrote:
>> On Thu, 25 Aug 2022 18:27:14 +0800 lizhe.67@...edance.com wrote:
>> 
>>> From: Li Zhe <lizhe.67@...edance.com>
>>> 
>>> 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 introduce a new boot parameter 'early_page_ext' to resolve this
>>> problem. If we pass it to kernel, function page_ext_init() will be moved
>>> up and feature 'deferred initialization of struct pages' will be disabled
>>> to initialize the page allocator early and prevent from the panic problem
>>> above. It can help us to catch early page allocations. This is useful
>>> especially when we find that the free memory value is not the same right
>>> after different kernel booting.
>>> 
>> 
>> WARNING: modpost: vmlinux.o: section mismatch in reference: early_page_ext_enabled (section: .text.unlikely) -> early_page_ext (section: .meminit.data)
>> WARNING: modpost: vmlinux.o: section mismatch in reference: early_page_ext_enabled (section: .text.unlikely) -> early_page_ext (section: .meminit.data)
>
>Hm it's a very small static inline, shouldn't exist separately anywhere.
>Maybe it's due to that new debug info level thing?
>
>Would this work instead?
>
>----8<----
>diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
>index 884282a7f03a..4bf4e58cf2d4 100644
>--- a/include/linux/page_ext.h
>+++ b/include/linux/page_ext.h
>@@ -40,7 +40,7 @@ extern bool early_page_ext;
> extern unsigned long page_ext_size;
> extern void pgdat_page_ext_init(struct pglist_data *pgdat);
> 
>-static inline bool early_page_ext_enabled(void)
>+static inline bool __meminit early_page_ext_enabled(void)
> {
> 	return early_page_ext;
> }

I think this is also a method to solve this problem.
Due to '__meminit', early_page_ext_enabled() can not be an inline function
now. So if we finally choose this method, I suggest we put function
early_page_ext_enabled() into page_ext.c if CONFIG_PAGE_EXTENSION=y, and
we can make 'early_page_ext' a static variable.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ