hugemmap35: Migrating libhugetlbfs test v6 truncate_reserve_wraparound.c
PATCH 1/1 hugemmap35: Migrating libhugetlbfs test v6 truncate_reserve_wraparound.c
This test verifies that the kernel correctly maintains hugepage reservation accounting when truncating a hugetlbfs file. It ensures that reserved hugepages are properly tracked through the complete lifecycle
--- runtest/hugetlb | 1 + testcases/kernel/mem/.gitignore | 1 + .../kernel/mem/hugetlb/hugemmap/hugemmap35.c | 124 ++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c
runtest/hugetlb +1 -0
@@ -36,6 +36,7 @@ hugemmap30 hugemmap30 hugemmap31 hugemmap31 hugemmap32 hugemmap32 hugemmap34 hugemmap34 +hugemmap35 hugemmap35 hugemmap05_1 hugemmap05 -m hugemmap05_2 hugemmap05 -s hugemmap05_3 hugemmap05 -s -m
testcases/kernel/mem/.gitignore +1 -0
@@ -36,6 +36,7 @@ /hugetlb/hugemmap/hugemmap31 /hugetlb/hugemmap/hugemmap32 /hugetlb/hugemmap/hugemmap34 +/hugetlb/hugemmap/hugemmap35 /hugetlb/hugeshmat/hugeshmat01 /hugetlb/hugeshmat/hugeshmat02 /hugetlb/hugeshmat/hugeshmat03
testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c new file +124 -0
124 lines not on this page · raw message
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Pavithra,
Quoted 1 line · Pavithra
hugemmap35: Migrating libhugetlbfs test v6
truncate_reserve_wraparound.c
The "v6" in the subject looks like a series revision tag left over from git-send-email. The libhugetlbfs source file has no "v6" in its name (the Origin URL confirms this). Please strip it before resubmitting.
Suggested subject:
"hugemmap35: migrate libhugetlbfs test truncate_reserve_wraparound.c"
Quoted 7 lines
+/*
+ * Origin: https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/truncate_reserve_wraparound.c
+ *
+ * Test that hugepage reservation accounting is correctly maintained when
+ * truncating a hugetlbfs file. This verifies that reserved hugepages are
+ * properly tracked through the complete lifecycle
+ */
The description block must open with /*\ (backslash after the opening /*) to be recognised as RST content and exported to the test catalog. A plain /* */ comment is not rendered there.
The Origin: URL is also inside what should be the RST doc block. It belongs in a separate plain /* */ comment before the /*\ ... */ block, or can simply be omitted (the commit message and .tags already record the provenance).
Rule 4 also requires documenting why root is needed. Hugetlbfs has to be mounted by root, so a sentence to that effect belongs in the block.
Suggested restructure:
/*
* Origin: https://github.com/libhugetlbfs/libhugetlbfs/blob/...
*/
/*\
* Test that hugepage reservation accounting is correctly maintained
* when truncating a hugetlbfs file. This verifies that reserved
* hugepages are properly tracked through the sequence of: mmap
* (reserves page), touch (instantiates page), truncate (releases
* page), and attempted access (triggers SIGBUS). A bug in i_size
* handling could cause the reservation count to become incorrect,
* leading to resource leaks or allocation failures.
*
* Requires root to mount hugetlbfs.
*/
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