Skip to content

Commit

Permalink
tools/testing/selftests/vm/gup_benchmark.c: add MAP_HUGETLB option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Keith Busch authored and torvalds committed Oct 26, 2018
1 parent 0dd8666 commit 3821b76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/testing/selftests/vm/gup_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3821b76

Please sign in to comment.