[LTP] getrusage03: account for percpu RSS counter batching
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Aug 25 19:34:39 CEST 2026
Hi Nirmoy,
On Aug 25, 2026, Nirmoy Das wrote:
> getrusage03: account for percpu RSS counter batching
> + long batch = MAX(32L, tst_ncpus() * 2);
> + long delta = MAXRSS_BATCHES * batch * SAFE_SYSCONF(_SC_PAGESIZE) / 1024;
Could this allowance also scale by the number of online CPUs? An mm's
anonymous RSS counter can retain up to batch - 1 pages on every CPU visited
by the child, and task migration does not flush the previous CPU's local
counter. Linux's own error bound in __percpu_counter_compare() is
batch * num_online_cpus().
For example, with 64 online CPUs and 4 KiB pages, the batch is 128 pages.
This code computes 1 MiB and therefore retains the old 20 MiB floor, while
partial batches on 41 CPUs can already omit more than 20 MiB. The failure
this patch intends to address therefore remains possible.
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