All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Wake Liu <wakel@google.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] ltp: syscalls/madvise09: Reset cgroup memory limits before test retries
Date: Wed,  8 Jul 2026 12:25:37 +0000	[thread overview]
Message-ID: <20260708122537.4017-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260708104215.507193-1-wakel@google.com>

Hi Wake,

On Wed, 08 Jul 2026 10:42:15 +0000, Wake Liu wrote:
> ltp: syscalls/madvise09: Reset cgroup memory limits before test retries

The commit message is missing a Signed-off-by: tag.

> +	/*
> +	 * Reset cgroup memory limits to default ("max") in case this is a retry run.
> +	 * Otherwise, the retried child inherits the strict MEM_LIMIT from the previous
> +	 * run, causing MADV_FREE pages to be dropped immediately before we touch them.
> +	 */
> +	if (SAFE_CG_HAS(tst_cg, "memory.max"))
> +		SAFE_CG_PRINTF(tst_cg, "memory.max", "max");

The SAFE_CG_HAS guard here is inconsistent with the unconditional
SAFE_CG_PRINTF call further down in the same function:

    SAFE_CG_PRINTF(tst_cg, "memory.max", "%d", MEM_LIMIT);

Both lines are on the same execution path. If memory.max could be absent,
the existing call would abort via the SAFE_* macro before the test even
reaches the limit-setting step. Since .needs_cgroup_ctrls requires the
memory controller, memory.max will always be present, making the guard
redundant. Dropping it and calling SAFE_CG_PRINTF directly would match the
pattern used in the rest of the function.

> +	if (swap_accounting_enabled && SAFE_CG_HAS(tst_cg, "memory.swap.max"))
> +		SAFE_CG_PRINTF(tst_cg, "memory.swap.max", "max");

The SAFE_CG_HAS check is redundant here. swap_accounting_enabled is set
in setup() only when SAFE_CG_HAS(tst_cg, "memory.swap.max") returns true,
so the condition already implies the file exists. The existing code that
sets SWAP_LIMIT just checks `if (swap_accounting_enabled)` -- the new code
should do the same.

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

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

  reply	other threads:[~2026-07-08 12:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 10:42 [LTP] [PATCH] ltp: syscalls/madvise09: Reset cgroup memory limits before test retries Wake Liu via ltp
2026-07-08 12:25 ` linuxtestproject.agent [this message]
2026-07-09 16:05 ` Andrea Cervesato via ltp
2026-07-10  2:15 ` [LTP] [PATCH v2] " Wake Liu via ltp
2026-07-10  4:56   ` [LTP] " linuxtestproject.agent
2026-07-10  6:52   ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-07-13  1:18     ` Wake Liu via ltp
2026-07-13  1:25   ` Wake Liu via ltp
2026-07-13  1:25   ` [LTP] [PATCH v3] madvise09: Reset cgroup limits before retrying test Wake Liu via ltp
2026-07-13  2:44     ` [LTP] " linuxtestproject.agent
2026-07-13 11:23       ` Andrea Cervesato via ltp
2026-07-13 11:42     ` [LTP] [PATCH v4] " Wake Liu via ltp
2026-07-13 14:09       ` [LTP] " linuxtestproject.agent
2026-07-14  7:57       ` [LTP] [PATCH v5] " Wake Liu via ltp
2026-07-14  8:06         ` [LTP] " linuxtestproject.agent
2026-07-14  8:09         ` [LTP] [PATCH v5] " Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260708122537.4017-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=wakel@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.