Re: [LTP] [PATCH v2] madvise09: Scale cgroup memory/swap limits dynamically with page size

Wei Gao via ltp <[email protected]> Mon, 27 Jul 2026 02:26:51 +0000
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp