mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 15:24:02 -04:00
This test stresses the race between of madvise(DONTNEED), a page fault
and a parallel huge page mmap, which should fail due to lack of
available page available for mapping.
This test case must run on a system with one and only one huge page
available.
# echo 1 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
During setup, the test allocates the only available page, and starts
three threads:
- thread 1:
* madvise(MADV_DONTNEED) on the allocated huge page
- thread 2:
* Write to the allocated huge page
- thread 3:
* Tries to allocated (steal) an extra huge page (which is not
available)
thread 3 should never succeed in the allocation, since the only huge
page was never unmapped, and should be reserved.
Touching the old page after thread3 allocation will raise a SIGBUS.
Link: https://lkml.kernel.org/r/20240105155419.1939484-2-leitao@debian.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Yang Shi <shy828301@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
50 lines
756 B
Plaintext
50 lines
756 B
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
cow
|
|
hugepage-mmap
|
|
hugepage-mremap
|
|
hugepage-shm
|
|
hugepage-vmemmap
|
|
hugetlb-madvise
|
|
hugetlb-read-hwpoison
|
|
khugepaged
|
|
map_hugetlb
|
|
map_populate
|
|
thuge-gen
|
|
compaction_test
|
|
migration
|
|
mlock2-tests
|
|
mrelease_test
|
|
mremap_dontunmap
|
|
mremap_test
|
|
on-fault-limit
|
|
transhuge-stress
|
|
pagemap_ioctl
|
|
*.tmp*
|
|
protection_keys
|
|
protection_keys_32
|
|
protection_keys_64
|
|
madv_populate
|
|
uffd-stress
|
|
uffd-unit-tests
|
|
mlock-intersect-test
|
|
mlock-random-test
|
|
virtual_address_range
|
|
gup_test
|
|
va_128TBswitch
|
|
map_fixed_noreplace
|
|
write_to_hugetlbfs
|
|
hmm-tests
|
|
memfd_secret
|
|
soft-dirty
|
|
split_huge_page_test
|
|
ksm_tests
|
|
local_config.h
|
|
local_config.mk
|
|
ksm_functional_tests
|
|
mdwe_test
|
|
gup_longterm
|
|
mkdirty
|
|
va_high_addr_switch
|
|
hugetlb_fault_after_madv
|
|
hugetlb_madv_vs_map
|