[Devel] [PATCH RHEL10 COMMIT] vmalloc: Rename module parameter variable

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 5 21:32:32 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.29.vz10
------>
commit f217d0162a26bd98ad4a379969f00293584997ae
Author: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
Date:   Tue Jun 2 21:11:02 2026 +0000

    vmalloc: Rename module parameter variable
    
    There's a collision between nr_threads and external
    variable with the same name.
    Rename it and make module parameter named to make
    change invisible to userspace.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-130116
    
    Feature: !CONFIG_VE build
    Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
    Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
---
 lib/test_vmalloc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index 4ddf769861ff7..78139224db200 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -23,7 +23,9 @@
 	module_param(name, type, 0444);			\
 	MODULE_PARM_DESC(name, msg)				\
 
-__param(int, nr_threads, 0,
+static int num_threads;
+module_param_named(nr_threads, num_threads, int, 0444);
+MODULE_PARM_DESC(nr_threads,
 	"Number of workers to perform tests(min: 1 max: USHRT_MAX)");
 
 __param(bool, sequential_test_order, false,
@@ -508,10 +510,10 @@ init_test_configuration(void)
 	 * value and set to USHRT_MAX. We add such gap just in
 	 * case and for potential heavy stressing.
 	 */
-	nr_threads = clamp(nr_threads, 1, (int) USHRT_MAX);
+	num_threads = clamp(num_threads, 1, (int) USHRT_MAX);
 
 	/* Allocate the space for test instances. */
-	tdriver = kvcalloc(nr_threads, sizeof(*tdriver), GFP_KERNEL);
+	tdriver = kvcalloc(num_threads, sizeof(*tdriver), GFP_KERNEL);
 	if (tdriver == NULL)
 		return -1;
 
@@ -540,7 +542,7 @@ static void do_concurrent_test(void)
 	 */
 	down_write(&prepare_for_test_rwsem);
 
-	for (i = 0; i < nr_threads; i++) {
+	for (i = 0; i < num_threads; i++) {
 		struct test_driver *t = &tdriver[i];
 
 		t->task = kthread_run(test_func, t, "vmalloc_test/%d", i);
@@ -567,7 +569,7 @@ static void do_concurrent_test(void)
 		ret = wait_for_completion_timeout(&test_all_done_comp, HZ);
 	} while (!ret);
 
-	for (i = 0; i < nr_threads; i++) {
+	for (i = 0; i < num_threads; i++) {
 		struct test_driver *t = &tdriver[i];
 		int j;
 


More information about the Devel mailing list