lkml.org 
[lkml]   [2022]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] selftests/vm: cleanup hugetlb file after mremap test
On Tue, Feb 1, 2022 at 11:35 AM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> 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.
>
> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
> ---
[...]
> diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
> index e09040a3dc08..e10d50e0b8e8 100755
> --- a/tools/testing/selftests/vm/run_vmtests.sh
> +++ b/tools/testing/selftests/vm/run_vmtests.sh
> @@ -111,13 +111,14 @@ fi
> echo "-----------------------"
> echo "running hugepage-mremap"
> echo "-----------------------"
> -./hugepage-mremap 256
> +./hugepage-mremap $mnt/huge_mremap
> if [ $? -ne 0 ]; then
> echo "[FAIL]"
> exitcode=1
> else
> echo "[PASS]"
> fi
> +rm -f $mnt/huge_mremap
>

A little strange (since file creation and deletion are not in the same place).
I know $mnt/huge_mremap is created in hugepage-mremap. But I think
hugepage-mremap should do the housekeeping instead of deleting the file
here. Or we can create the file before doing the test. Like:

+ touch $mnt/huge_mremap
-./hugepage-mremap 256
+./hugepage-mremap $mnt/huge_mremap
+rm -f $mnt/huge_mremap

Otherwise LGTM.

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

\
 
 \ /
  Last update: 2022-02-02 14:12    [W:0.058 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site