linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/test_vmalloc.c: Use late_initcall() if built-in for init ordering
@ 2025-06-23 18:40 Uladzislau Rezki (Sony)
  2025-06-23 18:40 ` [PATCH 2/2] lib/test_vmalloc.c: Restrict default test mask to avoid test warnings Uladzislau Rezki (Sony)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Uladzislau Rezki (Sony) @ 2025-06-23 18:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Baoquan He, Uladzislau Rezki, Harry Yoo,
	Suren Baghdasaryan, David Wang

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@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: David Wang <00107082@163.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.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
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Uladzislau Rezki");
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-24 11:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 18:40 [PATCH 1/2] lib/test_vmalloc.c: Use late_initcall() if built-in for init ordering Uladzislau Rezki (Sony)
2025-06-23 18:40 ` [PATCH 2/2] lib/test_vmalloc.c: Restrict default test mask to avoid test warnings Uladzislau Rezki (Sony)
2025-06-24  9:34   ` Baoquan He
2025-06-24  8:30 ` [PATCH 1/2] lib/test_vmalloc.c: Use late_initcall() if built-in for init ordering Baoquan He
2025-06-24  9:07 ` David Wang
2025-06-24 11:42   ` [PATCH " Uladzislau Rezki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).