Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/mm: gup_test: stop testing FOLL_TOUCH

commit 0f20bba1688b ("mm/gup: explicitly define and check internal GUP
flags, disallow FOLL_TOUCH") marked FOLL_TOUCH as a GUP-internal flag.

This causes a warning to fire when running gup_test, for example:

$ ./gup_test -L -r 100 -z

dmesg:
WARNING: CPU: 1 PID: 117 at mm/gup.c:2512 is_valid_gup_args+0x66/0x8c

Therefore, remove the "FOLL_TOUCH" test code from gup_test.c.

Link: https://lkml.kernel.org/r/20251117154012.197499-1-peng8420.li@gmail.com
Signed-off-by: Peng Li <peng8420.li@gmail.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Peng Li and committed by
Andrew Morton
218fbfad cab812d9

+4 -18
+4 -18
tools/testing/selftests/mm/gup_test.c
··· 19 19 20 20 /* Just the flags we need, copied from mm.h: */ 21 21 #define FOLL_WRITE 0x01 /* check pte is writable */ 22 - #define FOLL_TOUCH 0x02 /* mark page accessed */ 23 22 24 23 #define GUP_TEST_FILE "/sys/kernel/debug/gup_test" 25 24 ··· 92 93 { 93 94 struct gup_test gup = { 0 }; 94 95 int filed, i, opt, nr_pages = 1, thp = -1, write = 1, nthreads = 1, ret; 95 - int flags = MAP_PRIVATE, touch = 0; 96 + int flags = MAP_PRIVATE; 96 97 char *file = "/dev/zero"; 97 98 pthread_t *tid; 98 99 char *p; ··· 169 170 case 'H': 170 171 flags |= (MAP_HUGETLB | MAP_ANONYMOUS); 171 172 break; 172 - case 'z': 173 - /* fault pages in gup, do not fault in userland */ 174 - touch = 1; 175 - break; 176 173 default: 177 174 ksft_exit_fail_msg("Wrong argument\n"); 178 175 } ··· 239 244 else if (thp == 0) 240 245 madvise(p, size, MADV_NOHUGEPAGE); 241 246 242 - /* 243 - * FOLL_TOUCH, in gup_test, is used as an either/or case: either 244 - * fault pages in from the kernel via FOLL_TOUCH, or fault them 245 - * in here, from user space. This allows comparison of performance 246 - * between those two cases. 247 - */ 248 - if (touch) { 249 - gup.gup_flags |= FOLL_TOUCH; 250 - } else { 251 - for (; (unsigned long)p < gup.addr + size; p += psize()) 252 - p[0] = 0; 253 - } 247 + /* Fault them in here, from user space. */ 248 + for (; (unsigned long)p < gup.addr + size; p += psize()) 249 + p[0] = 0; 254 250 255 251 tid = malloc(sizeof(pthread_t) * nthreads); 256 252 assert(tid);