diff mbox series

[23/40] selftests/vm: 10x speedup for hmm-tests

Message ID 20201017231447.uw23bzJ9_%akpm@linux-foundation.org (mailing list archive)
State New, archived
Headers show
Series [01/40] ia64: fix build error with !COREDUMP | expand

Commit Message

Andrew Morton Oct. 17, 2020, 11:14 p.m. UTC
From: John Hubbard <jhubbard@nvidia.com>
Subject: selftests/vm: 10x speedup for hmm-tests

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.

Link: https://lkml.kernel.org/r/20201003011721.44238-1-jhubbard@nvidia.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Suggested-by: Ralph Campbell <rcampbell@nvidia.com>
Cc: SeongJae Park <sj38.park@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

 tools/testing/selftests/vm/hmm-tests.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


--- a/tools/testing/selftests/vm/hmm-tests.c~selftests-vm-10x-speedup-for-hmm-tests
+++ a/tools/testing/selftests/vm/hmm-tests.c
@@ -49,7 +49,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)))