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-05-10 10:19:01 +01:00
2021-06-14 23:06:38 +02:00
2021-02-08 17:04:41 -07:00
2021-04-30 11:20:38 -07:00
2020-12-19 16:23:19 +01:00
2021-04-02 16:41:08 +02:00
2021-02-08 16:25:53 -07:00
2021-04-23 14:01:28 -07:00
2021-05-22 15:09:07 -10:00
2021-05-06 19:24:13 -07:00
2021-03-23 14:51:50 +01:00
2021-02-11 16:22:32 -05:00
2021-03-08 11:59:16 +01:00
2021-02-08 16:32:43 -07:00
2021-06-24 04:04:38 -04:00
2021-04-22 12:22:11 -07:00
2021-04-08 14:05:20 +02:00
2021-05-07 00:26:33 -07:00
2021-01-24 14:43:45 +01:00
2021-05-20 12:51:24 -07:00
2021-06-18 12:13:24 -07:00
2021-06-09 21:06:35 +02:00
2021-05-18 16:20:54 -05:00
2021-05-07 00:34:51 -07:00
2021-06-05 08:58:11 -07:00
2021-03-24 17:20:18 -07:00
2021-04-07 16:37:49 -06:00
2021-05-21 00:58:03 +10:00
2021-04-06 09:43:41 +02:00
2021-02-06 00:21:42 +01:00
2021-05-23 17:16:09 -07:00
2021-04-21 22:52:32 +10:00
2021-03-26 11:37:17 -06:00
2021-02-08 16:38:34 -07:00
2021-06-30 20:47:27 -07:00
2021-06-04 14:25:14 -07:00
2021-03-18 11:05:14 +01:00
2021-02-15 11:43:28 +01:00
2021-01-21 14:06:00 -07:00
2021-02-15 11:07:42 +01:00
2021-04-29 11:57:23 -07:00
2021-04-22 12:22:11 -07:00