Skip to content

Commit c71d956

Browse files
committed
selftests/mm: restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh
JIRA: https://issues.redhat.com/browse/RHEL-86180 commit 585a914 Author: Donet Tom <donettom@linux.ibm.com> Date: Thu Apr 10 05:07:48 2025 -0500 selftests/mm: restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh During cleanup, the value of /proc/sys/vm/nr_hugepages is currently being set to 0. At the end of the test, if all tests pass, the original nr_hugepages value is restored. However, if any test fails, it remains set to 0. With this patch, we ensure that the original nr_hugepages value is restored during cleanup, regardless of whether the test passes or fails. Link: https://lkml.kernel.org/r/20250410100748.2310-1-donettom@linux.ibm.com Fixes: 29750f7 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests") Signed-off-by: Donet Tom <donettom@linux.ibm.com> Cc: Li Wang <liwang@redhat.com> Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Waiman Long <longman@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Li Wang <liwang@redhat.com>
1 parent a90bf1d commit c71d956

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/mm/hugetlb_reparenting_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function cleanup() {
5656
rmdir "$CGROUP_ROOT"/a/b 2>/dev/null
5757
rmdir "$CGROUP_ROOT"/a 2>/dev/null
5858
rmdir "$CGROUP_ROOT"/test1 2>/dev/null
59-
echo 0 >/proc/sys/vm/nr_hugepages
59+
echo $nr_hugepgs >/proc/sys/vm/nr_hugepages
6060
set -e
6161
}
6262

0 commit comments

Comments
 (0)