[LTP] [PATCH] hugeshmctl02: set 2 huge pages as an enforced requirement

Li Wang liwang@redhat.com
Thu Oct 30 12:35:34 CET 2025


Set hugeshmctl02 to require exactly 2 HugeTLB pages and bail out
cleanly if unavailable. To prevent shmget EINVAL failures seen when
the environment cannot provide enough hugepages.

Stabilizes the test across constrained systems while keeping functional
intent intact.

  === error log ===
  cmdline="hugeshmctl02 -s 1 -i 5;"
  tst_hugepage.c:84: TINFO: 1 hugepage(s) reserved
  tst_test.c:1709: TINFO: LTP version: 20240129
  tst_test.c:1595: TINFO: Timeout per run is 0h 00m 30s
  hugeshmctl02.c:105: TINFO: Testing variant: libc shmctl()
  hugeshmctl02.c:119: TBROK: shmget #1: EINVAL (22)

Signed-off-by: Li Wang <liwang@redhat.com>
Cc: Luiz Capitulino <luizcap@redhat.com>
---
 testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
index d3f711129..82126f52c 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
@@ -143,5 +143,5 @@ static struct tst_test test = {
 	},
 	.setup = setup,
 	.cleanup = cleanup,
-	.hugepages = {128, TST_REQUEST},
+	.hugepages = {2, TST_NEEDS},
 };
-- 
2.51.0



More information about the ltp mailing list