Skip to contentSkip to conversation

selftests/mm: Dont fail testsuite due to a lack of hugepages

PATCH Superseded Nico Pache 2 participants 4 messages Mar 1, 2024 – Mar 5, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Nico Pache

author
#0 lore raw

PATCH 1/1 selftests/mm: Dont fail testsuite due to a lack of hugepages

On systems that have large core counts and large page sizes, but limited memory, the userfaultfd test hugepage requirement is too large.

Exiting early due to missing one test's requirements is a rather aggressive strategy, and prevents a lot of other tests from running. Remove the early exit to prevent this.

Fixes ee00479d6702 ("selftests: vm: Try harder to allocate huge pages")
---
 tools/testing/selftests/mm/run_vmtests.sh | 1 -
 1 file changed, 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +0 -1
index 246d53a5d7f28..727ea22ba408e 100755
@@ -173,7 +173,6 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then
 	if [ "$freepgs" -lt "$needpgs" ]; then
 		printf "Not enough huge pages available (%d < %d)\n" \
 		       "$freepgs" "$needpgs"
-		exit 1
 	fi
 else
 	echo "no hugetlbfs support in kernel?"
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Nico Pache

On systems that have large core counts and large page sizes, but limited memory, the userfaultfd test hugepage requirement is too large.

Exiting early due to missing one test's requirements is a rather aggressive strategy, and prevents a lot of other tests from running. Remove the early exit to prevent this.

Why don't we only skip that particular test which requires huge number of pages instead? Thus the behavior of this script would remain same.

Quoted 19 lines
Fixes ee00479d6702 ("selftests: vm: Try harder to allocate huge pages")
---
 tools/testing/selftests/mm/run_vmtests.sh | 1 -
 1 file changed, 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +0 -1
index 246d53a5d7f28..727ea22ba408e 100755
@@ -173,7 +173,6 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then
 	if [ "$freepgs" -lt "$needpgs" ]; then
 		printf "Not enough huge pages available (%d < %d)\n" \
 		       "$freepgs" "$needpgs"
-		exit 1
 	fi
 else
 	echo "no hugetlbfs support in kernel?"
Signature · 2 lines
BR,
Muhammad Usama Anjum
author
#2 lore raw
Quoted 10 lines · Muhammad Usama Anjum
Quoted 6 lines · Nico Pache

On systems that have large core counts and large page sizes, but limited memory, the userfaultfd test hugepage requirement is too large.

Exiting early due to missing one test's requirements is a rather aggressive strategy, and prevents a lot of other tests from running. Remove the early exit to prevent this.

Why don't we only skip that particular test which requires huge number of pages instead? Thus the behavior of this script would remain same.

Hi Muhammad,

That would not solve the problem-- The issue is not with the userfaultfd test, but rather this part of the script that tries to allocate the hugepages. If it doesnt succeed at allocating the right amount of hugepages it will exit the run_vmtests.sh script, thus stopping all other tests. With the exit removed, the test suite is able to run, and upon running the userfaultfd test will result in a failed test case.

If you'd like I can follow up with a patch to skip the test cases (in the actually test) rather than failing.

Cheers,
-- Nico

Quoted 25 lines
Quoted 13 lines
Fixes ee00479d6702 ("selftests: vm: Try harder to allocate huge pages")
---
 tools/testing/selftests/mm/run_vmtests.sh | 1 -
 1 file changed, 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +0 -0
index 246d53a5d7f28..727ea22ba408e 100755

tools/testing/selftests/mm/run_vmtests.sh if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then · line 178

Quoted 7 lines
tools/testing/selftests/mm/run_vmtests.sh +0 -1
@@ -173,7 +173,6 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then
      if [ "$freepgs" -lt "$needpgs" ]; then
              printf "Not enough huge pages available (%d < %d)\n" \
                     "$freepgs" "$needpgs"
-             exit 1
      fi
 else
      echo "no hugetlbfs support in kernel?"

--
BR,
Muhammad Usama Anjum

#3 lore raw
Quoted 22 lines · Nico Pache
Quoted 10 lines · Muhammad Usama Anjum
Quoted 6 lines · Nico Pache

On systems that have large core counts and large page sizes, but limited memory, the userfaultfd test hugepage requirement is too large.

Exiting early due to missing one test's requirements is a rather aggressive strategy, and prevents a lot of other tests from running. Remove the early exit to prevent this.

Why don't we only skip that particular test which requires huge number of pages instead? Thus the behavior of this script would remain same.

Hi Muhammad,

That would not solve the problem-- The issue is not with the userfaultfd test, but rather this part of the script that tries to allocate the hugepages. If it doesnt succeed at allocating the right amount of hugepages it will exit the run_vmtests.sh script, thus stopping all other tests. With the exit removed, the test suite is able to run, and upon running the userfaultfd test will result in a failed test case.

Quoted 2 lines

If you'd like I can follow up with a patch to skip the test cases (in the actually test) rather than failing.

Its just that we don't want failures if there are less number of huge pages available. CI people would mind finding failures. Tests should be updated to skip in those cases then.

Quoted 30 lines

Cheers,
-- Nico

Quoted 25 lines
Quoted 13 lines
Fixes ee00479d6702 ("selftests: vm: Try harder to allocate huge pages")
---
 tools/testing/selftests/mm/run_vmtests.sh | 1 -
 1 file changed, 1 deletion(-)
tools/testing/selftests/mm/run_vmtests.sh +0 -0
index 246d53a5d7f28..727ea22ba408e 100755

tools/testing/selftests/mm/run_vmtests.sh if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then · line 178

Quoted 7 lines
tools/testing/selftests/mm/run_vmtests.sh +0 -1
@@ -173,7 +173,6 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then
      if [ "$freepgs" -lt "$needpgs" ]; then
              printf "Not enough huge pages available (%d < %d)\n" \
                     "$freepgs" "$needpgs"
-             exit 1
      fi
 else
      echo "no hugetlbfs support in kernel?"

--
BR,
Muhammad Usama Anjum

Signature · 2 lines
BR,
Muhammad Usama Anjum