]> Git Repo - linux.git/commitdiff
selftests/vm: 10x speedup for hmm-tests
authorJohn Hubbard <[email protected]>
Sat, 17 Oct 2020 23:14:47 +0000 (16:14 -0700)
committerLinus Torvalds <[email protected]>
Sun, 18 Oct 2020 16:27:09 +0000 (09:27 -0700)
This patch reduces the running time for hmm-tests from about 10+ seconds,
to just under 1.0 second, for an approximately 10x speedup.  That brings
it in line with most of the other tests in selftests/vm, which mostly run
in < 1 sec.

This is done with a one-line change that simply reduces the number of
iterations of several tests, from 256, to 10.  Thanks to Ralph Campbell
for suggesting changing NTIMES as a way to get the speedup.

Suggested-by: Ralph Campbell <[email protected]>
Signed-off-by: John Hubbard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Shuah Khan <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
tools/testing/selftests/vm/hmm-tests.c

index 0a28a6a295812a5e848e924c0cafee793ab2951c..c9404ef9698e2b2d96c96178dc64529cc4014470 100644 (file)
@@ -45,7 +45,7 @@ struct hmm_buffer {
 #define TWOMEG         (1 << 21)
 #define HMM_BUFFER_SIZE (1024 << 12)
 #define HMM_PATH_MAX    64
-#define NTIMES         256
+#define NTIMES         10
 
 #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1)))
 
This page took 0.055431 seconds and 4 git commands to generate.