From: SJ Park <sj@kernel.org>
To: longlong yan <yanlonglong@kylinos.cn>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
shuah@kernel.org
Subject: Re: [PATCH v2] selftests/damon: Add missing NULL checks after malloc()
Date: Mon, 20 Jul 2026 23:41:03 -0700 [thread overview]
Message-ID: <20260721064104.182094-1-sj@kernel.org> (raw)
In-Reply-To: <20260721060542.326-1-yanlonglong@kylinos.cn>
Hello longlong,
From the next time, when someone asked questions to your patch, please answer
the questions and keep the discussion until the next action item becomes clear.
Please don't post a new version without making sure such discussion is done.
Also, don't post a new version of a patch as a reply to the previous version.
Post as a new thread from the next time.
On Tue, 21 Jul 2026 14:05:42 +0800 longlong yan <yanlonglong@kylinos.cn> wrote:
> In low-memory scenarios, malloc() can fail. Without checking,
> the test will dereference NULL and crash, causing the test harness
> to report a failure that is unrelated to DAMON functionality.
'test harness' means the DAMON selftests that internally runs the access_memory
and access_memory_even programs, suc as damos_apply_interval.py, right? Could
you share more details about how the test harness report a failure in the
situation?
> This is a false negative:
Shouldn't it be called false positive, as this is a context of tests?
> the test should skip or report a resource error,
> not crash and mask the actual test result.
>
> Add NULL checks after each malloc() call, printing an error message
> to stderr and returning -1 on failure.
The above description reads like this patch makes the DAMON selftets skip or
report a resource error. But I don't show how that works. Could you please
elaborate?
>
> Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
> ---
Please add changelog on the commentary area [1], with links to the previous
revisions.
[1] https://docs.kernel.org/process/submitting-patches.html#commentary
Thanks,
SJ
[...]
prev parent reply other threads:[~2026-07-21 6:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 2:58 [PATCH] selftests/damon: Add missing NULL checks after malloc() longlong yan
2026-07-21 4:31 ` SJ Park
2026-07-21 6:05 ` [PATCH v2] " longlong yan
2026-07-21 6:41 ` SJ Park [this message]
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=20260721064104.182094-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
--cc=yanlonglong@kylinos.cn \
/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