linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: Restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh
@ 2025-04-10 10:07 Donet Tom
  2025-04-15  6:58 ` Anshuman Khandual
  0 siblings, 1 reply; 4+ messages in thread
From: Donet Tom @ 2025-04-10 10:07 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kselftest, Shuah Khan
  Cc: Ritesh Harjani, longman, Li Wang, Donet Tom

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.

Fixes: 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
---
 tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh
index 11f9bbe7dc22..114875a2b018 100755
--- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh
+++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh
@@ -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
 }
 
-- 
2.47.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-15 10:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-10 10:07 [PATCH] selftests/mm: Restore default nr_hugepages value during cleanup in hugetlb_reparenting_test.sh Donet Tom
2025-04-15  6:58 ` Anshuman Khandual
2025-04-15  7:30   ` Dev Jain
2025-04-15 10:18     ` Donet Tom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox