diff options
| author | David Hildenbrand <[email protected]> | 2024-03-26 15:32:09 +0100 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-04-25 20:56:13 -0700 |
| commit | c139ca42f5740f0c94a001eee82dafada72c19ee (patch) | |
| tree | d6f91d2b0294eedd050b96eec6cd3861e5a6f022 /tools/perf/scripts/python | |
| parent | 5b34b76cb0cd8a21dee5c7677eae98480b0d05cc (diff) | |
selftests/memfd_secret: add vmsplice() test
Let's add a simple reproducer for a scenario where GUP-fast could succeed
on secretmem folios, making vmsplice() succeed instead of failing. The
reproducer is based on a reproducer [1] by Miklos Szeredi.
We want to perform two tests: vmsplice() when a fresh page was just
faulted in, and vmsplice() on an existing page after munmap() that would
drain certain LRU caches/batches in the kernel.
In an ideal world, we could use fallocate(FALLOC_FL_PUNCH_HOLE) /
MADV_REMOVE to remove any existing page. As that is currently not
possible, run the test before any other tests that would allocate memory
in the secretmem fd.
Perform the ftruncate() only once, and check the return value.
[1] https://lkml.kernel.org/r/CAJfpegt3UCsMmxd0taOY11Uaw5U=eS1fE5dn0wZX3HF0oy8-oQ@mail.gmail.com
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: David Hildenbrand <[email protected]>
Reviewed-by: Mike Rapoport (IBM) <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: xingwei lee <[email protected]>
Cc: yue sun <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions