selftests/vm: cleanup hugetlb file after mremap test
authorMike Kravetz <mike.kravetz@oracle.com>
Sat, 5 Mar 2022 04:28:48 +0000 (20:28 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Mar 2022 19:08:32 +0000 (11:08 -0800)
commitff712a627f7296a42ea5d7356704525e1e909e05
tree6088a44412b5772d3304e0863ef4ab16088130e7
parent07ebd38a0da24d2534da57b4841346379db9f354
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>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/vm/hugepage-mremap.c
tools/testing/selftests/vm/run_vmtests.sh