From: Keith Busch Date: Fri, 26 Oct 2018 22:10:12 +0000 (-0700) Subject: tools/testing/selftests/vm/gup_benchmark.c: add MAP_HUGETLB option X-Git-Tag: v4.20-rc1~92^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3821b76c3cdb5f2c5ef1b082de79829e8ff50a7d;p=thirdparty%2Fkernel%2Flinux.git tools/testing/selftests/vm/gup_benchmark.c: add MAP_HUGETLB option Add a new option '-H' to the gup benchmark to help understand how hugetlb mapping pages compare with the default. Link: http://lkml.kernel.org/r/20181010195605.10689-6-keith.busch@intel.com Signed-off-by: Keith Busch Reviewed-by: Andrew Morton Cc: Kirill Shutemov Cc: Dave Hansen Cc: Dan Williams Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/tools/testing/selftests/vm/gup_benchmark.c b/tools/testing/selftests/vm/gup_benchmark.c index 5c8e4cb1441af..880b96fc80d4c 100644 --- a/tools/testing/selftests/vm/gup_benchmark.c +++ b/tools/testing/selftests/vm/gup_benchmark.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) char *file = "/dev/zero"; char *p; - while ((opt = getopt(argc, argv, "m:r:n:f:tTLUS")) != -1) { + while ((opt = getopt(argc, argv, "m:r:n:f:tTLUSH")) != -1) { switch (opt) { case 'm': size = atoi(optarg) * MB; @@ -69,6 +69,9 @@ int main(int argc, char **argv) flags &= ~MAP_PRIVATE; flags |= MAP_SHARED; break; + case 'H': + flags |= MAP_HUGETLB; + break; default: return -1; }