]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting
authorWaiman Long <longman@redhat.com>
Fri, 14 Jan 2022 22:07:58 +0000 (14:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 14:30:30 +0000 (16:30 +0200)
commit22d0be4374fbae2419942ae45a62cec3fb9ab896
tree48001922721999c4beb15c07945dc0c066fb31a7
parent4ddbc691cde70c522b3fac86b1aad20bee9f95a2
selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting

The hugetlb cgroup reservation test charge_reserved_hugetlb.sh assume
that no cgroup filesystems are mounted before running the test.  That is
not true in many cases.  As a result, the test fails to run.  Fix that
by querying the current cgroup mount setting and using the existing
cgroup setup instead before attempting to freshly mount a cgroup
filesystem.

Similar change is also made for hugetlb_reparenting_test.sh as well,
though it still has problem if cgroup v2 isn't used.

The patched test scripts were run on a centos 8 based system to verify
that they ran properly.

Link: https://lkml.kernel.org/r/20220106201359.1646575-1-longman@redhat.com
Fixes: 9def9cad29d9 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Mina Almasry <almasrymina@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/vm/charge_reserved_hugetlb.sh
tools/testing/selftests/vm/hugetlb_reparenting_test.sh
tools/testing/selftests/vm/write_hugetlb_memory.sh