selftests/mm: Restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh
Subsystems (3)
PATCH 1/1 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.
--- tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/hugetlb_reparenting_test.sh +1 -1
@@ -56,7 +56,7 @@ function cleanup() { rmdir "$CGROUP_ROOT"/a/b 2>/dev/null rmdir "$CGROUP_ROOT"/a 2>/dev/null rmdir "$CGROUP_ROOT"/test1 2>/dev/null - echo 0 >/proc/sys/vm/nr_hugepages + echo $nr_hugepgs >/proc/sys/vm/nr_hugepages set -e }
Signature · 1 line
2.47.1
Quoted 9 lines · Donet Tom
During cleanup, the value of
/proc/sys/vm/nr_hugepagesis currently being set to 0. At the end of the test, if all tests pass, the originalnr_hugepagesvalue is restored. However, if any test fails, it remains set to 0.With this patch, we ensure that the original
nr_hugepagesvalue is restored during cleanup, regardless of whether the test passes or fails.Fixes 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
Although this change makes sense as an improvement or a cleanup but not sure if this also deserves a Fixes: tag as well.
Quoted 18 lines
Signed-off-by Donet Tom <[email protected]>--- tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/hugetlb_reparenting_test.sh +1
-1@@ -56,7 +56,7 @@ function cleanup() { rmdir "$CGROUP_ROOT"/a/b 2>/dev/null rmdir "$CGROUP_ROOT"/a 2>/dev/null rmdir "$CGROUP_ROOT"/test1 2>/dev/null - echo 0 >/proc/sys/vm/nr_hugepages + echo $nr_hugepgs >/proc/sys/vm/nr_hugepages set -e }
Quoted 8 lines · Anshuman Khandual
Quoted 5 lines · Donet Tom
During cleanup, the value of
/proc/sys/vm/nr_hugepagesis currently being set to 0. At the end of the test, if all tests pass, the originalnr_hugepagesvalue is restored. However, if any test fails, it remains set to 0.
Quoted 6 lines
Quoted 4 lines
With this patch, we ensure that the original
nr_hugepagesvalue is restored during cleanup, regardless of whether the test passes or fails.Fixes 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")Although this change makes sense as an improvement or a cleanup but not sure if this also deserves a Fixes: tag as well.
IMHO it deserves a Fixes tag, the tests should always cleanly exit without changing system state. It may or may not cause an actual problem, so let's be proactive : )
Quoted 20 lines
Quoted 19 lines
Signed-off-by Donet Tom <[email protected]>--- tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/hugetlb_reparenting_test.sh +1
-1@@ -56,7 +56,7 @@ function cleanup() { rmdir "$CGROUP_ROOT"/a/b 2>/dev/null rmdir "$CGROUP_ROOT"/a 2>/dev/null rmdir "$CGROUP_ROOT"/test1 2>/dev/null - echo 0 >/proc/sys/vm/nr_hugepages + echo $nr_hugepgs >/proc/sys/vm/nr_hugepages set -e }
Quoted 11 lines · Dev Jain
Quoted 8 lines · Anshuman Khandual
Quoted 5 lines · Donet Tom
During cleanup, the value of
/proc/sys/vm/nr_hugepagesis currently being set to 0. At the end of the test, if all tests pass, the originalnr_hugepagesvalue is restored. However, if any test fails, it remains set to 0.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
With this patch, we ensure that the original
nr_hugepagesvalue is restored during cleanup, regardless of whether the test passes or fails.Fixes 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")Although this change makes sense as an improvement or a cleanup but not sure if this also deserves a Fixes: tag as well.
IMHO it deserves a Fixes tag, the tests should always cleanly exit without changing system state. It may or may not cause an actual problem, so let's be proactive : )
Yes, I was thinking the same.
Quoted 22 lines
Quoted 20 lines
Quoted 19 lines
Signed-off-by Donet Tom <[email protected]>---
tools/testing/selftests/mm/hugetlb_reparenting_test.sh| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/hugetlb_reparenting_test.sh +0
-0@@ -56,7 +56,7 @@ function cleanup() {rmdir "$CGROUP_ROOT"/a/b 2>/dev/null
rmdir "$CGROUP_ROOT"/a 2>/dev/null
rmdir "$CGROUP_ROOT"/test1 2>/dev/null
- echo 0 >/proc/sys/vm/nr_hugepages
+ echo $nr_hugepgs >/proc/sys/vm/nr_hugepages
set -e
}