From: SJ Park <sj@kernel.org>
To: sashiko-bot@kernel.org
Cc: SJ Park <sj@kernel.org>, damon@lists.linux.dev
Subject: Re: [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
Date: Thu, 17 Sep 2026 07:36:19 -0700 [thread overview]
Message-ID: <20260917143621.91542-1-sj@kernel.org> (raw)
In-Reply-To: <20260917143154.DC7301F000FF@smtp.kernel.org>
On Thu, 17 Sep 2026 14:31:54 +0000 sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] selftests/damon: test falsely passes on minimal grep due to --quiet flag
> --
>
> commit 3a025795f6efb7b8edc7858f005049159a83efbe
> Author: SJ Park <sj@kernel.org>
>
> selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
>
> This commit updates the DAMON sysfs_memcg_path_leak selftest to explicitly
> check the kmemleak report for "memcg_path_store". It exits with success if the
> leak doesn't appear to be related to DAMON, reducing false positive failures.
>
> > diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
> > --- a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
> > +++ b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
> > @@ -41,5 +41,12 @@ if [ "$kmemleak_report" = "" ]
> > then
> > exit 0
> > fi
> > +if ! echo "$kmemleak_report" | grep "memcg_path_store" --quiet
>
> [Severity: Medium]
> Will this script falsely pass in environments with a minimal grep
> implementation?
>
> If this selftest is executed in an environment (like some BusyBox builds or
> Alpine Linux) where grep does not support the GNU --quiet extension, grep
> will exit with an error code.
>
> The ! operator will negate this non-zero exit code, causing the condition
> to evaluate to true. The script will then enter the then block and exit
> successfully (exit 0), potentially masking real kernel memory leaks.
>
> Could this use -q instead of --quiet to be more portable?
I believe modern test infrastructures support --quiet. So no blocker. We can
revisit this if there is any report.
>
> > +then
> > + echo "[WARN] memleak found; apparently not from DAMON, though"
> > + echo "$kmemleak_report"
> > + exit 0
> > +fi
> > +
> > echo "$kmemleak_report"
> > exit 1
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260917142210.90829-1-sj@kernel.org?part=9
Thanks,
SJ
next prev parent reply other threads:[~2026-09-17 14:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 14:21 ` [PATCH 01/10] mm/damon/api: remove NR_DAMOS_FILTER_TYPES SJ Park
2026-09-17 14:25 ` sashiko-bot
2026-09-17 14:43 ` Gutierrez Asier
2026-09-19 13:02 ` Zenghui Yu
2026-09-19 15:57 ` SJ Park
2026-09-20 1:23 ` Zenghui Yu
2026-09-17 14:22 ` [PATCH 02/10] mm/damon/core: use abs_diff() in damon_feed_loop_next_input() SJ Park
2026-09-17 14:25 ` sashiko-bot
2026-09-17 14:43 ` Gutierrez Asier
2026-09-17 14:22 ` [PATCH 03/10] mm/damon/core: use mult_frac() " SJ Park
2026-09-17 14:25 ` sashiko-bot
2026-09-17 14:44 ` Gutierrez Asier
2026-09-17 14:22 ` [PATCH 04/10] mm/damon/core: set damon_ctx->walk_control_obsolete in damon_new_ctx() SJ Park
2026-09-17 14:29 ` sashiko-bot
2026-09-17 14:22 ` [PATCH 05/10] mm/damon/core: document damon_call()/damon_start() race hang issue SJ Park
2026-09-17 14:26 ` sashiko-bot
2026-09-17 14:22 ` [PATCH 06/10] mm/damon/paddr: remove pa parameter from damon_pa_filter_pass() SJ Park
2026-09-17 14:24 ` sashiko-bot
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
2026-09-17 14:26 ` sashiko-bot
2026-09-17 14:22 ` [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park
2026-09-17 14:26 ` sashiko-bot
2026-09-17 14:22 ` [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
2026-09-17 14:31 ` sashiko-bot
2026-09-17 14:36 ` SJ Park [this message]
2026-09-17 14:22 ` [PATCH 10/10] Docs/mm/damon/design: clarify bp is basis point SJ Park
2026-09-17 14:26 ` sashiko-bot
2026-09-19 12:39 ` Zenghui Yu
2026-09-17 14:37 ` [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 21:57 ` Andrew Morton
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=20260917143621.91542-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=damon@lists.linux.dev \
--cc=sashiko-bot@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox