linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-next 1/1] lib/test_vmalloc.c: extend max value of nr_threads parameter
@ 2021-04-06 12:45 Uladzislau Rezki (Sony)
  0 siblings, 0 replies; only message in thread
From: Uladzislau Rezki (Sony) @ 2021-04-06 12:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Uladzislau Rezki, Hillf Danton, Michal Hocko,
	Matthew Wilcox, Oleksiy Avramchenko, Steven Rostedt

Currently a maximum value is set to 1024 workers the user can
create during the test. It might be that for some big systems
it is not enough. Since it is a test thing we can give testers
more flexibility.

Increase that number till USHRT_MAX that corresponds to 65535.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 lib/test_vmalloc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index d337985e4c5e..01e9543de566 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -24,7 +24,7 @@
 	MODULE_PARM_DESC(name, msg)				\
 
 __param(int, nr_threads, 0,
-	"Number of workers to perform tests(min: 1 max: 1024)");
+	"Number of workers to perform tests(min: 1 max: USHRT_MAX)");
 
 __param(bool, sequential_test_order, false,
 	"Use sequential stress tests order");
@@ -469,13 +469,13 @@ init_test_configurtion(void)
 {
 	/*
 	 * A maximum number of workers is defined as hard-coded
-	 * value and set to 1024. We add such gap just in case
-	 * and for potential heavy stressing.
+	 * value and set to USHRT_MAX. We add such gap just in
+	 * case and for potential heavy stressing.
 	 */
-	nr_threads = clamp(nr_threads, 1, 1024);
+	nr_threads = clamp(nr_threads, 1, (int) USHRT_MAX);
 
 	/* Allocate the space for test instances. */
-	tdriver = kcalloc(nr_threads, sizeof(*tdriver), GFP_KERNEL);
+	tdriver = kvcalloc(nr_threads, sizeof(*tdriver), GFP_KERNEL);
 	if (tdriver == NULL)
 		return -1;
 
@@ -555,7 +555,7 @@ static void do_concurrent_test(void)
 			i, t->stop - t->start);
 	}
 
-	kfree(tdriver);
+	kvfree(tdriver);
 }
 
 static int vmalloc_test_init(void)
-- 
2.20.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 12:45 [PATCH-next 1/1] lib/test_vmalloc.c: extend max value of nr_threads parameter Uladzislau Rezki (Sony)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox