lib/test_vmalloc.c: use late_initcall() if built-in for init ordering
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Mon, 23 Jun 2025 18:40:34 +0000 (20:40 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:42:21 +0000 (22:42 -0700)
commit2e728505494b21b874fa87fce233c63b43d74434
tree587c8091c1ff63f17e89c2f94c126a633caf64a4
parentd1600be2f68a6f79a1ea3993b7ab84fcbb824879
lib/test_vmalloc.c: use late_initcall() if built-in for init ordering

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.

Link: https://lkml.kernel.org/r/20250623184035.581229-1-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Cc: Harry Yoo <harry.yoo@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: David Wang <00107082@163.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_vmalloc.c