selftests/vm: cow: basic COW tests for non-anonymous pages
authorDavid Hildenbrand <david@redhat.com>
Wed, 16 Nov 2022 10:26:41 +0000 (11:26 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 30 Nov 2022 23:58:57 +0000 (15:58 -0800)
commitf8664f3c4a08f799122e8f0a8093056a7b3fbc8d
treeaa54e9a5cbea4e3adc9a698f497ec62d90d012f4
parent7aca5ca154930a06612f4d7b81f710f3e1027e04
selftests/vm: cow: basic COW tests for non-anonymous pages

Let's add basic tests for COW with non-anonymous pages in private
mappings: write access should properly trigger COW and result in the
private changes not being visible through other page mappings.

Especially, add tests for:
* Zeropage
* Huge zeropage
* Ordinary pagecache pages via memfd and tmpfile()
* Hugetlb pages via memfd

Fortunately, all tests pass.

Link: https://lkml.kernel.org/r/20221116102659.70287-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/vm/cow.c