]> Git Repo - linux.git/commit
selftests/mm: add a new test for madv and hugetlb
authorBreno Leitao <[email protected]>
Thu, 5 Oct 2023 16:39:22 +0000 (09:39 -0700)
committerAndrew Morton <[email protected]>
Wed, 18 Oct 2023 21:34:16 +0000 (14:34 -0700)
commit116d57303a051bb2c7939a5026e441d8a7845db2
tree3f4d8b02cc4de46b6b6b63b21e1b53512aaef520
parentc8b90731427814b1e265c3c2bc01c38406963c32
selftests/mm: add a new test for madv and hugetlb

Create a selftest that exercises the race between page faults and
madvise(MADV_DONTNEED) in the same huge page. Do it by running two
threads that touches the huge page and madvise(MADV_DONTNEED) at the same
time.

In case of a SIGBUS coming at pagefault, the test should fail, since we
hit the bug.

The test doesn't have a signal handler, and if it fails, it fails like
the following

  ----------------------------------
  running ./hugetlb_fault_after_madv
  ----------------------------------
  ./run_vmtests.sh: line 186: 595563 Bus error    (core dumped) "$@"
  [FAIL]

This selftest goes together with the fix of the bug[1] itself.

[1] https://lore.kernel.org/all/20231001005659.2185316[email protected]/#r

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Breno Leitao <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Tested-by: Rik van Riel <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Muchun Song <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
tools/testing/selftests/mm/Makefile
tools/testing/selftests/mm/hugetlb_fault_after_madv.c [new file with mode: 0644]
tools/testing/selftests/mm/run_vmtests.sh
This page took 0.056982 seconds and 4 git commands to generate.