Re: [LTP] [PATCH v2] madvise09: Scale cgroup memory/swap limits dynamically with page size
Li Wang <[email protected]> Fri, 24 Jul 2026 17:05:15 +0800
| Newsgroups | it.linux.lists.ltp |
|---|---|
| Message-ID | <[email protected]> |
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.
> 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