[LTP] hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Mon Aug 31 11:12:42 CEST 2026
Hi Pavithra,
On Aug 31, 2026, Pavithra wrote:
> hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting
> for (b = a; b < a + size; b += hpage_size)
> *b = 1;
>
> tst_res(TINFO, "Testing unused quota cleanup for untouched mappings");
> run_quota_test(verify_quota_ok, hpage_size, MAP_PRIVATE);
> verify_quota_stat(1, 1, 1);
verify_quota_ok() faults and instantiates every page, so this does not test
cleanup of an untouched mapping. Use a map/unmap helper that does not access
the mapping before checking the quota counters.
> TESTPTR(mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0));
> c = TST_RET_PTR;
> if (c == MAP_FAILED) {
> if (TST_ERR == ENOMEM) {
> tst_res(TPASS | TERRNO, "COW mmap failed as expected due to quota");
No copy-on-write fault occurs because the second mapping is never accessed.
This retests private mmap reservation accounting; exercise a private write
that requires COW, or remove the COW claim.
> static void run_test(void)
> {
> tst_res(TINFO, "Testing unused quota cleanup for untouched mappings");
> run_quota_test(verify_quota_ok, hpage_size, MAP_PRIVATE);
> ...
> run_quota_test(verify_quota_ok, hpage_size, MAP_PRIVATE);
> }
>
> static struct tst_test test = {
> ...
> .test_all = run_test,
These multiple cases are manually dispatched through .test_all. Represent
them with a tcase array and use .test with .tcnt.
> +/hugetlb/hugemmap/hugemmap33
Test binaries must be ignored by a .gitignore in their own directory. Move
this entry to testcases/kernel/mem/hugetlb/hugemmap/.gitignore.
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
More information about the ltp
mailing list