Skip to contentSkip to conversation

fixup! selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation

PATCH In review [email protected] 2 participants 2 messages Apr 3, 2024 – Apr 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixup! selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation

From: Peter Xu <[email protected]>

Fix up a breakage on uffd hugetlb test due to removal of a temp variable, as reported by Ryan [1].

Instead of using the previous calculation, use the largest we can have (which is put in freepgs) and cut it into half for userfault tests.

[1] https://lore.kernel.org/r/[email protected]

Cc Muhammad Usama Anjum <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Muchun Song <[email protected]>
---
 tools/testing/selftests/mm/run_vmtests.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +2 -1
index b1b78e45d613..223c2304f885 100755
@@ -298,7 +298,8 @@ CATEGORY="userfaultfd" run_test ./uffd-unit-tests
 uffd_stress_bin=./uffd-stress
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} anon 20 16
 # Hugetlb tests require source and destination huge pages. Pass in half
-# the size ($half_ufd_size_MB), which is used for *each*.
+# the size of the free pages we have, which is used for *each*.
+half_ufd_size_MB=$((freepgs / 2))
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb "$half_ufd_size_MB" 32
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb-private "$half_ufd_size_MB" 32
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} shmem 20 16
Signature · 1 line
2.44.0
Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · On 03/04/2024 21:03, [email protected] wrote:

From: Peter Xu <[email protected]>

Fix up a breakage on uffd hugetlb test due to removal of a temp variable, as reported by Ryan [1].

Instead of using the previous calculation, use the largest we can have (which is put in freepgs) and cut it into half for userfault tests.

Quoted 7 lines

[1] https://lore.kernel.org/r/[email protected]

Cc Muhammad Usama Anjum <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Muchun Song <[email protected]>

All passing again for me:

Quoted 18 lines
---
 tools/testing/selftests/mm/run_vmtests.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +2 -1
index b1b78e45d613..223c2304f885 100755
@@ -298,7 +298,8 @@ CATEGORY="userfaultfd" run_test ./uffd-unit-tests
 uffd_stress_bin=./uffd-stress
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} anon 20 16
 # Hugetlb tests require source and destination huge pages. Pass in half
-# the size ($half_ufd_size_MB), which is used for *each*.
+# the size of the free pages we have, which is used for *each*.
+half_ufd_size_MB=$((freepgs / 2))
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb "$half_ufd_size_MB" 32
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb-private "$half_ufd_size_MB" 32
 CATEGORY="userfaultfd" run_test ${uffd_stress_bin} shmem 20 16