The patch titled Subject: mm/gup_benchmark: add LONGTERM_BENCHMARK test in gup fast path has been added to the -mm tree. Its filename is mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Pingfan Liu <kernelfans@xxxxxxxxx> Subject: mm/gup_benchmark: add LONGTERM_BENCHMARK test in gup fast path Introduce a GUP_LONGTERM_BENCHMARK ioctl to test longterm pin in gup fast path. Link: http://lkml.kernel.org/r/1560422702-11403-4-git-send-email-kernelfans@xxxxxxxxx Signed-off-by: Pingfan Liu <kernelfans@xxxxxxxxx> Cc: Ira Weiny <ira.weiny@xxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: John Hubbard <jhubbard@xxxxxxxxxx> Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxx> Cc: Keith Busch <keith.busch@xxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Cc: Shuah Khan <shuah@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/gup_benchmark.c | 11 +++++++++-- tools/testing/selftests/vm/gup_benchmark.c | 10 +++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) --- a/mm/gup_benchmark.c~mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path +++ a/mm/gup_benchmark.c @@ -6,8 +6,9 @@ #include <linux/debugfs.h> #define GUP_FAST_BENCHMARK _IOWR('g', 1, struct gup_benchmark) -#define GUP_LONGTERM_BENCHMARK _IOWR('g', 2, struct gup_benchmark) -#define GUP_BENCHMARK _IOWR('g', 3, struct gup_benchmark) +#define GUP_FAST_LONGTERM_BENCHMARK _IOWR('g', 2, struct gup_benchmark) +#define GUP_LONGTERM_BENCHMARK _IOWR('g', 3, struct gup_benchmark) +#define GUP_BENCHMARK _IOWR('g', 4, struct gup_benchmark) struct gup_benchmark { __u64 get_delta_usec; @@ -53,6 +54,11 @@ static int __gup_benchmark_ioctl(unsigne nr = get_user_pages_fast(addr, nr, gup->flags & 1, pages + i); break; + case GUP_FAST_LONGTERM_BENCHMARK: + nr = get_user_pages_fast(addr, nr, + (gup->flags & 1) | FOLL_LONGTERM, + pages + i); + break; case GUP_LONGTERM_BENCHMARK: nr = get_user_pages(addr, nr, (gup->flags & 1) | FOLL_LONGTERM, @@ -96,6 +102,7 @@ static long gup_benchmark_ioctl(struct f switch (cmd) { case GUP_FAST_BENCHMARK: + case GUP_FAST_LONGTERM_BENCHMARK: case GUP_LONGTERM_BENCHMARK: case GUP_BENCHMARK: break; --- a/tools/testing/selftests/vm/gup_benchmark.c~mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path +++ a/tools/testing/selftests/vm/gup_benchmark.c @@ -15,8 +15,9 @@ #define PAGE_SIZE sysconf(_SC_PAGESIZE) #define GUP_FAST_BENCHMARK _IOWR('g', 1, struct gup_benchmark) -#define GUP_LONGTERM_BENCHMARK _IOWR('g', 2, struct gup_benchmark) -#define GUP_BENCHMARK _IOWR('g', 3, struct gup_benchmark) +#define GUP_FAST_LONGTERM_BENCHMARK _IOWR('g', 2, struct gup_benchmark) +#define GUP_LONGTERM_BENCHMARK _IOWR('g', 3, struct gup_benchmark) +#define GUP_BENCHMARK _IOWR('g', 4, struct gup_benchmark) struct gup_benchmark { __u64 get_delta_usec; @@ -37,7 +38,7 @@ int main(int argc, char **argv) char *file = "/dev/zero"; char *p; - while ((opt = getopt(argc, argv, "m:r:n:f:tTLUSH")) != -1) { + while ((opt = getopt(argc, argv, "m:r:n:f:tTlLUSH")) != -1) { switch (opt) { case 'm': size = atoi(optarg) * MB; @@ -54,6 +55,9 @@ int main(int argc, char **argv) case 'T': thp = 0; break; + case 'l': + cmd = GUP_FAST_LONGTERM_BENCHMARK; + break; case 'L': cmd = GUP_LONGTERM_BENCHMARK; break; _ Patches currently in -mm which might be from kernelfans@xxxxxxxxx are mm-gup-rename-nr-as-nr_pinned-in-get_user_pages_fast.patch mm-gup-fix-omission-of-check-on-foll_longterm-in-gup-fast-path.patch mm-gup_benchemark-add-longterm_benchmark-test-in-gup-fast-path.patch