Skip to content

Commit 585a914

Browse files
donettom-1akpm00
authored andcommitted
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/[email protected] Fixes: 29750f7 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests") Signed-off-by: Donet Tom <[email protected]> Cc: Li Wang <[email protected]> Cc: "Ritesh Harjani (IBM)" <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Waiman Long <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2a6ed1b commit 585a914

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)