Skip to contentSkip to conversation

hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

PATCH Superseded Pavithra 2 participants 2 messages Sep 5

v7 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Pavithra

author
#0 lore raw

PATCH v7 1/1 hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

Test hugetlbfs quota accounting with filesystem size limits to check for regressions in quota handling for MAP_PRIVATE and MAP_SHARED pages.

---
v6 -> v7:
- Name function pointer parameters 'size' and 'mmap_flags' to fix make check warnings.
Link to v6: https://lore.kernel.org/ltp/[email protected]/

---
 runtest/hugetlb                               |   1 +
 testcases/kernel/mem/.gitignore               |   1 +
 .../kernel/mem/hugetlb/hugemmap/hugemmap33.c  | 260 ++++++++++++++++++
 3 files changed, 262 insertions(+)
 create mode 100644 testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c
runtest/hugetlb +1 -0
index 621c9718a..e3ee42c2f 100644
@@ -35,6 +35,7 @@ hugemmap29 hugemmap29
 hugemmap30 hugemmap30
 hugemmap31 hugemmap31
 hugemmap32 hugemmap32
+hugemmap33 hugemmap33
 hugemmap34 hugemmap34
 hugemmap35 hugemmap35
 hugemmap36 hugemmap36
testcases/kernel/mem/.gitignore +1 -0
index 9e706e1c8..763f134dd 100644
@@ -35,6 +35,7 @@
 /hugetlb/hugemmap/hugemmap30
 /hugetlb/hugemmap/hugemmap31
 /hugetlb/hugemmap/hugemmap32
+/hugetlb/hugemmap/hugemmap33
 /hugetlb/hugemmap/hugemmap34
 /hugetlb/hugemmap/hugemmap35
 /hugetlb/hugemmap/hugemmap36
testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c new file +260 -0

260 lines not on this page · raw message

Signature · 5 lines
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Pavithra,

Quoted 3 lines · Pavithra

hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

+/hugetlb/hugemmap/hugemmap33

New test binaries must be ignored by a .gitignore in their own directory. Move this entry to testcases/kernel/mem/hugetlb/hugemmap/.gitignore as /hugemmap33.

testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c line 63

Quoted 3 lines
testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c new file +3 -0
+	TESTPTR(mmap(NULL, size, PROT_READ | PROT_WRITE, mmap_flags, fd, 0));
+	if (TST_RET_PTR == MAP_FAILED) {
+		tst_res(TFAIL | TERRNO, "mmap failed unexpectedly");

Use TST_EXP_PASS_PTR_VOID() for expected successes and TST_EXP_FAIL_PTR_VOID(..., ENOMEM) for expected failures instead of manually combining TESTPTR(), errno checks, and tst_res(). Keep only the cleanup logic that depends on TST_PASS or TST_RET_PTR.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp