[LTP] [PATCH v2] madvise09: Scale cgroup memory/swap limits dynamically with page size
Wei Gao
wegao@suse.com
Mon Jul 27 04:26:51 CEST 2026
On Fri, Jul 24, 2026 at 05:05:15PM +0800, Li Wang wrote:
> Wei Gao via ltp wrote:
>
> > + mem_limit = 16 * PAGES * page_size;
> > + swap_limit = 2 * mem_limit;
> > +
>
> > + if (swap_accounting_enabled && (tst_available_swap() < swap_limit / 1024)) {
> > + tst_brk(TCONF, "System needs at least %lldMB free swap to run this test",
> > + swap_limit / TST_MB);
>
> I suspect this available swap size comparison is duplicated with
> .min_swap_avail, and perhaps we can remove BASE_SWAP_LIMIT and
> .min_swap_avail from the test directly.
Thanks, new patch sent.
>
> > static struct tst_test test = {
> > @@ -291,6 +301,6 @@ static struct tst_test test = {
> > .test_all = run,
> > .needs_root = 1,
> > .forks_child = 1,
>
> > - .min_swap_avail = SWAP_LIMIT / TST_MB,
> > + .min_swap_avail = BASE_SWAP_LIMIT / TST_MB,
>
> --
> Regards,
> Li Wang
More information about the ltp
mailing list