selftests/vm: cleanup hugetlb file after mremap test
authorMike Kravetz <mike.kravetz@oracle.com>
Mon, 28 Feb 2022 22:58:51 +0000 (09:58 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 22:58:51 +0000 (09:58 +1100)
commit0cc03016026446585cb39305985b9be049645120
tree8cf3308cf59e11fa75aa50f7602168b73de58967
parent7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3
selftests/vm: cleanup hugetlb file after mremap test

The hugepage-mremap test will create a file in a hugetlb filesystem.  In a
default 'run_vmtests' run, the file will contain all the hugetlb pages.
After the test, the file remains and there are no free hugetlb pages for
subsequent tests.  This causes those hugetlb tests to fail.

Change hugepage-mremap to take the name of the hugetlb file as an
argument.  Unlink the file within the test, and just to be sure remove the
file in the run_vmtests script.

Link: https://lkml.kernel.org/r/20220201033459.156944-1-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Mina Almasry <almasrymina@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
tools/testing/selftests/vm/hugepage-mremap.c
tools/testing/selftests/vm/run_vmtests.sh