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: <aFqPFPmR1sZQzMS0@pc636>
Date: Tue, 24 Jun 2025 13:42:12 +0200
From: Uladzislau Rezki <urezki@...il.com>
To: David Wang <00107082@....com>
Cc: "Uladzislau Rezki (Sony)" <urezki@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	LKML <linux-kernel@...r.kernel.org>, Baoquan He <bhe@...hat.com>,
	Harry Yoo <harry.yoo@...cle.com>,
	Suren Baghdasaryan <surenb@...gle.com>
Subject: Re: [PATCH 1/2] lib/test_vmalloc.c: Use late_initcall() if built-in
 for init ordering

On Tue, Jun 24, 2025 at 05:07:15PM +0800, David Wang wrote:
> 
> At 2025-06-24 02:40:34, "Uladzislau Rezki (Sony)" <urezki@...il.com> wrote:
> >When the vmalloc test code is compiled as a built-in, use late_initcall()
> >instead of module_init() to defer a vmalloc test execution until most
> >subsystems are up and running.
> >
> >It avoids interfering with components that may not yet be initialized
> >at module_init() time. For example, there was a recent report of memory
> >profiling infrastructure not being ready early enough leading to kernel
> >crash.
> >
> >By using late_initcall() in the built-in case, we ensure the tests are
> >run at a safer point during a boot sequence.
> >
> >Cc: Harry Yoo <harry.yoo@...cle.com>
> >Cc: Suren Baghdasaryan <surenb@...gle.com>
> >Cc: David Wang <00107082@....com>
> >Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
> >---
> > lib/test_vmalloc.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> >diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> >index 1b0b59549aaf1..7264781750c96 100644
> >--- a/lib/test_vmalloc.c
> >+++ b/lib/test_vmalloc.c
> >@@ -598,7 +598,11 @@ static int __init vmalloc_test_init(void)
> > 	return IS_BUILTIN(CONFIG_TEST_VMALLOC) ? 0:-EAGAIN;
> > }
> > 
> >+#ifdef MODULE
> > module_init(vmalloc_test_init)
> >+#else
> >+late_initcall(vmalloc_test_init);
> 
> >+#endif
> 
> 
> When MODULE defined,  late_initcall is defined as module_init in ./include/linux/module.h
> I think the MODULE check here is redundant,  (it is clearer though)
> 
That was an idea to use MODULE, because late_initcall is designed not
for module.s It would require the comment then.

--
Uladzislau Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ