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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 26 Aug 2022 18:32:17 +0800
From:   lizhe.67@...edance.com
To:     akpm@...ux-foundation.org
Cc:     Jason@...c4.com, 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,
        vbabka@...e.cz
Subject: Re: [PATCH v4] page_ext: introduce boot parameter 'early_page_ext'

On Thu, 25 Aug 2022 21:23:38 -0700, akpm@...ux-foundation.org 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)

Sorry for introducing this WARNING. I did multiple checks before submitting
the patch but unluckily I didn't trigger this WARNING. Maybe there are some
differences of config in our compilation environment. I have tried gcc 8.3
and gcc 11.2.1.

>
>I did this, but it was lazy - perhaps there's a better-optimized
>combination of section tags.  Please check?
>
>--- a/mm/page_ext.c~page_ext-introduce-boot-parameter-early_page_ext-fix
>+++ a/mm/page_ext.c
>@@ -91,7 +91,7 @@ unsigned long page_ext_size = sizeof(str
> static unsigned long total_usage;
> static struct page_ext *lookup_page_ext(const struct page *page);
> 
>-bool early_page_ext __meminitdata;
>+bool early_page_ext;
> static int __init setup_early_page_ext(char *str)
> {
> 	early_page_ext = true;
>_

Thanks for the fix.
I try '__initdata', it triggers another WARNING below.

WARNING: modpost: vmlinux.o: section mismatch in reference: memmap_init_range (section: .meminit.text) -> early_page_ext (section: .init.data)

I check the section tags in include/linux/init.h. It seems that we don't have
a better choise. So in my opinion, your patch is the best solution.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ