summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/vm
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-10-26 15:10:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-26 16:38:15 -0700
commit3821b76c3cdb5f2c5ef1b082de79829e8ff50a7d (patch)
tree40d7816b202d8873420e932c83585cf0339163f6 /tools/testing/selftests/vm
parent0dd8666afb99c71d124e0c2abf1ad7d934a242a0 (diff)
downloadlinux-3821b76c3cdb5f2c5ef1b082de79829e8ff50a7d.tar.bz2
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 <keith.busch@intel.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/vm')
-rw-r--r--tools/testing/selftests/vm/gup_benchmark.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/gup_benchmark.c b/tools/testing/selftests/vm/gup_benchmark.c
index 5c8e4cb1441a..880b96fc80d4 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;
}