OSDN Git Service

selftests/mm: create uffd-common.[ch]
authorPeter Xu <peterx@redhat.com>
Wed, 12 Apr 2023 16:42:41 +0000 (12:42 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:30:04 +0000 (16:30 -0700)
commit33be4e892877eec7c8eb32988b95f5c42c87f0f0
tree23a7eb720c029c95d2b8dc258b8fb556d05034fe
parent618aeb5d6255a7c2db2ac9cb850e5e044dd916c5
selftests/mm: create uffd-common.[ch]

Move common utility functions into uffd-common.[ch] files from the
original userfaultfd.c.  This prepares for a split of userfaultfd.c into
two tests: one to only cover the old but powerful stress test, the other
one covers all the functional tests.

This movement is kind of a brute-force effort for now, with light
touch-ups but nothing should really change.  There's chances to optimize
more, but let's leave that for later.

Link: https://lkml.kernel.org/r/20230412164241.328259-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/Makefile
tools/testing/selftests/mm/uffd-common.c [new file with mode: 0644]
tools/testing/selftests/mm/uffd-common.h [new file with mode: 0644]
tools/testing/selftests/mm/userfaultfd.c