diff options
| author | Uladzislau Rezki (Sony) <[email protected]> | 2025-04-17 16:12:14 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-05-12 00:48:34 +0000 |
| commit | 2d76e79315e403aab595d4c8830b7a46c19f0f3b (patch) | |
| tree | 3ea422dcc34cb2e3e85c645e5b9ed3ce9b157feb /lib/test_vmalloc.c | |
| parent | lib/test_vmalloc.c: replace RWSEM to SRCU for setup (diff) | |
| download | kernel-2d76e79315e403aab595d4c8830b7a46c19f0f3b.tar.gz kernel-2d76e79315e403aab595d4c8830b7a46c19f0f3b.zip | |
lib/test_vmalloc.c: allow built-in execution
Remove the dependency on module loading ("m") for the vmalloc test suite,
enabling it to be built directly into the kernel, so both ("=m") and
("=y") are supported.
Motivation:
- Faster debugging/testing of vmalloc code;
- It allows to configure the test via kernel-boot parameters.
Configuration example:
test_vmalloc.nr_threads=64
test_vmalloc.run_test_mask=7
test_vmalloc.sequential_test_order=1
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
Reviewed-by: Baoquan He <[email protected]>
Reviewed-by: Adrian Huang <[email protected]>
Tested-by: Adrian Huang <[email protected]>
Cc: Christop Hellwig <[email protected]>
Cc: Mateusz Guzik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_vmalloc.c')
| -rw-r--r-- | lib/test_vmalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index 399751022eea..1b0b59549aaf 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -591,10 +591,11 @@ static void do_concurrent_test(void) kvfree(tdriver); } -static int vmalloc_test_init(void) +static int __init vmalloc_test_init(void) { do_concurrent_test(); - return -EAGAIN; /* Fail will directly unload the module */ + /* Fail will directly unload the module */ + return IS_BUILTIN(CONFIG_TEST_VMALLOC) ? 0:-EAGAIN; } module_init(vmalloc_test_init) |
