DAMON development mailing list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
Date: Sat, 12 Sep 2026 20:15:18 +0000	[thread overview]
Message-ID: <20260912201518.700171F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260912200814.145612-8-sj@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Use of the non-standard `--quiet` flag in `grep` can cause the test to silently mask real memory leaks on systems with strict POSIX grep implementations.
- [Low] Typo in the warning message: 'apparenty' instead of 'apparently'.
--

commit afc83fe4758b4c2e76cc3da97cb99e2a990b6b83
Author: SJ Park <sj@kernel.org>

selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak

The selftest can fail for any leak if it happens while the test is running.
Remove the false positive test failures by further checking if the expected
leaking function is called out on the report.

> diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
> index 33a7ff43ed6cc..6c2d8bb3fe570 100755
> --- 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]
Could the --quiet flag cause the test to accidentally mask real memory leaks?

If the test runs in an environment with a strict POSIX grep implementation
that does not support the GNU extension --quiet, grep will fail with an
unrecognized option error.

Because of the negated condition, a non-zero exit code from grep causes the
script to evaluate to true, print a warning, and exit 0. Should the standard
POSIX -q flag be used instead to ensure compatibility?

> +then
> +	echo "[WARN] memleak found; apparenty not from DAMON, though"

[Severity: Low]
This isn't a bug, but there is a typo in the warning message (apparenty
instead of apparently).

> +	echo "$kmemleak_report"
> +	exit 0
> +fi
> +
>  echo "$kmemleak_report"
>  exit 1

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260912200814.145612-1-sj@kernel.org?part=7

  reply	other threads:[~2026-09-12 20:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 20:08 [RFC PATCH 0/9] mm/damon: cleanup, clarify, and add/improve test SJ Park
2026-09-12 20:08 ` [RFC PATCH 1/9] mm/damon/api: remove NR_DAMOS_FILTER_TYPES SJ Park
2026-09-12 20:10   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 2/9] mm/damon/core: use abs_diff() in damon_feed_loop_next_input() SJ Park
2026-09-12 20:14   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 3/9] mm/damon/core: use mult_frac() " SJ Park
2026-09-12 20:12   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 4/9] mm/damon/core: use damos_quota_is_set() in damos_adjust_quota() SJ Park
2026-09-12 20:14   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 5/9] mm/damon/core: document damon_call()/damon_start() race hang issue SJ Park
2026-09-12 20:19   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 6/9] mm/damon/paddr: remove pa parameter from damon_pa_filter_pass() SJ Park
2026-09-12 20:13   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
2026-09-12 20:15   ` sashiko-bot [this message]
2026-09-12 20:20     ` SJ Park
2026-09-12 20:08 ` [RFC PATCH 8/9] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
2026-09-12 20:10   ` sashiko-bot
2026-09-12 20:08 ` [RFC PATCH 9/9] Docs/mm/damon/design: clarify bp is basis point SJ Park
2026-09-12 20:10   ` sashiko-bot
2026-09-12 20:26   ` Randy Dunlap

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=20260912201518.700171F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sj@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