Axel Rasmussen
fa2c2b5818
userfaultfd/selftests: use memfd_create for shmem test type
This is a preparatory commit. In the future, we want to be able to setup
alias mappings for area_src and area_dst in the shmem test, like we do in
the hugetlb_shared test. With a VMA obtained via mmap(MAP_ANONYMOUS |
MAP_SHARED), it isn't clear how to do this.
So, mmap() with an fd, so we can create alias mappings. Use memfd_create
instead of actually passing in a tmpfs path like hugetlb does, since it's
more convenient / simpler to run, and works just as well.
Future commits will:
1. Setup the alias mappings.
2. Extend our tests to actually take advantage of this, to test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup fails
in main(), pass in the right argv[] so we actually print out the hugetlb
file path.
Link: https://lkml.kernel.org/r/20210503180737.2487560-8-axelrasmussen@google.com
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Wang Qing <wangqing@vivo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-30 20:47:27 -07:00
..
2021-06-11 12:54:24 -03:00
2021-06-08 16:44:00 -04:00
2021-05-25 16:18:32 +02:00
2021-05-17 12:10:03 +09:00
2021-04-23 14:42:40 -07:00
2021-04-08 11:41:22 -06:00
2021-03-26 14:56:19 +01:00
2021-03-25 19:13:52 +00:00
2021-06-19 10:15:22 -03:00
2021-05-07 06:06:22 -04:00
2021-06-07 17:44:03 -07:00
2021-04-06 14:45:04 +02:00
2021-06-11 08:53:06 +02:00
2021-06-19 10:09:08 -03:00
2021-05-05 12:24:29 -07:00
2021-05-17 12:10:03 +09:00
2021-04-22 16:30:39 +01:00
2021-06-30 20:47:27 -07:00
2021-04-25 05:26:13 +09:00
2021-03-18 12:58:26 -04:00
2021-05-07 00:26:34 -07:00
2021-06-29 10:53:47 -07:00
2021-02-12 11:52:59 -05:00