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]
Message-ID: <YwXczj8Dh0uI0EA9@dhcp22.suse.cz>
Date:   Wed, 24 Aug 2022 10:09:50 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     lizhe.67@...edance.com
Cc:     akpm@...ux-foundation.org, vbabka@...e.cz, mhiramat@...nel.org,
        keescook@...omium.org, Jason@...c4.com, mark-pk.tsai@...iatek.com,
        rostedt@...dmis.org, corbet@....net, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        lizefan.x@...edance.com, yuanzhu@...edance.com
Subject: Re: [PATCH v2] page_ext: introduce boot parameter 'early_page_ext'

On Wed 24-08-22 14:50:58, lizhe.67@...edance.com wrote:
[...]
> diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
> index fabb2e1e087f..3e081cf8a1ec 100644
> --- a/include/linux/page_ext.h
> +++ b/include/linux/page_ext.h
> @@ -38,19 +38,22 @@ struct page_ext {
>  
>  extern unsigned long page_ext_size;
>  extern void pgdat_page_ext_init(struct pglist_data *pgdat);
> +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> +extern bool early_page_ext_enable(void);
> +#endif
>  
>  #ifdef CONFIG_SPARSEMEM
>  static inline void page_ext_init_flatmem(void)
>  {
>  }
> -extern void page_ext_init(void);
> +extern void page_ext_init(bool early);
>  static inline void page_ext_init_flatmem_late(void)
>  {
>  }
>  #else
>  extern void page_ext_init_flatmem(void);
>  extern void page_ext_init_flatmem_late(void);
> -static inline void page_ext_init(void)
> +static inline void page_ext_init(bool early)
>  {
>  }
>  #endif

Why do you need to make it CONFIG_DEFERRED_STRUCT_PAGE_INIT
dependant?

[...]
> diff --git a/init/main.c b/init/main.c
> index 91642a4e69be..3760c0326525 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -849,6 +849,8 @@ static void __init mm_init(void)
>  	pgtable_init();
>  	debug_objects_mem_init();
>  	vmalloc_init();
> +	/* Should be run after vmap initialization */
> +	page_ext_init(true);

you can just 
	if (early_page_ext)
		page_ext_init();

>  	/* Should be run before the first non-init thread is created */
>  	init_espfix_bsp();
>  	/* Should be run after espfix64 is set up. */
> @@ -1606,7 +1608,7 @@ static noinline void __init kernel_init_freeable(void)
>  	padata_init();
>  	page_alloc_init_late();
>  	/* Initialize page ext after all struct pages are initialized. */
> -	page_ext_init();
> +	page_ext_init(false);

	if (!early_page_ext)
		page_ext_init();
>  
>  	do_basic_setup();
>  

and without the ifdefery it all becomes much more simple.
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ