From: SeongJae Park <sj@kernel.org>
To: Honggyu Kim <honggyu.kim@sk.com>
Cc: SeongJae Park <sj@kernel.org>,
damon@lists.linux.dev, Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, kernel_team@skhynix.com,
Yunjeong Mun <yunjeong.mun@sk.com>
Subject: Re: [PATCH 3/3] samples/damon: fix bugs for damon sample for start failures
Date: Sun, 22 Jun 2025 09:29:34 -0700 [thread overview]
Message-ID: <20250622162935.51108-1-sj@kernel.org> (raw)
In-Reply-To: <20250622120926.1712-4-honggyu.kim@sk.com>
Hi Honggyu,
On Sun, 22 Jun 2025 21:09:25 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:
> The damon_sample_{wsse,prcl,mtier}_start() can fail so we must reset the
> "enabled" parameter to "false" again for proper rollback.
>
> In such cases, setting Y to "enabled" then N triggers the following
> crash because damon sample start failed but the "enabled" stays as Y.
>
> [ 2441.419649] damon_sample_prcl: start
> [ 2454.146817] damon_sample_prcl: stop
> [ 2454.146862] ------------[ cut here ]------------
> [ 2454.146865] kernel BUG at mm/slub.c:546!
> [ 2454.148183] Oops: invalid opcode: 0000 [#1] SMP NOPTI
> ...
> [ 2454.167555] Call Trace:
> [ 2454.167822] <TASK>
> [ 2454.168061] damon_destroy_ctx+0x78/0x140
> [ 2454.168454] damon_sample_prcl_enable_store+0x8d/0xd0
> [ 2454.168932] param_attr_store+0xa1/0x120
> [ 2454.169315] module_attr_store+0x20/0x50
> [ 2454.169695] sysfs_kf_write+0x72/0x90
> [ 2454.170065] kernfs_fop_write_iter+0x150/0x1e0
> [ 2454.170491] vfs_write+0x315/0x440
> [ 2454.170833] ksys_write+0x69/0xf0
> [ 2454.171162] __x64_sys_write+0x19/0x30
> [ 2454.171525] x64_sys_call+0x18b2/0x2700
> [ 2454.171900] do_syscall_64+0x7f/0x680
> [ 2454.172258] ? exit_to_user_mode_loop+0xf6/0x180
> [ 2454.172694] ? clear_bhb_loop+0x30/0x80
> [ 2454.173067] ? clear_bhb_loop+0x30/0x80
> [ 2454.173439] entry_SYSCALL_64_after_hwframe+0x76/0x7e
Thank you for finding and fixing this!
>
> Since it's just a sample module, no need to add it to stable tree.
I agree this is not a real bug. But, even a bug in DAMON unit test was
deserved to get a CVE id. Hence I'd suggest adding at least Fixes: tag here,
and let stable kernels maintainers to decide whether to pick this up to stable
kernels or not. I can help backporting if needed.
If you agree, I think we could add
Fixes: b757c6cfc696d ("samples/damon/wsse: start and stop DAMON as the user requests")
If we want to make stable kernel maintainers' life easier, we would better to
split this into three patches, for each module, and add appropriate Fixes, as
below.
For wsse,
Fixes: b757c6cfc696d ("samples/damon/wsse: start and stop DAMON as the user requests")
For prcl,
Fixes: 2aca254620a8 ("samples/damon: introduce a skeleton of a smaple DAMON module for proactive reclamation")
For mtier,
Fixes: 82a08bde3cf7 ("samples/damon: implement a DAMON module for memory tiering")
Could you please do so?
>
> Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> Cc: Yunjeong Mun <yunjeong.mun@sk.com>
Regardless of your agreement on adding Fixes:
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
next prev parent reply other threads:[~2025-06-22 16:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-22 12:09 [PATCH 0/3] mm/damon: Enhance damon and its samples Honggyu Kim
2025-06-22 12:09 ` [PATCH 1/3] mm/damon: do not allow creating zero size region Honggyu Kim
2025-06-22 16:04 ` SeongJae Park
2025-06-23 2:58 ` Honggyu Kim
2025-06-23 18:03 ` SeongJae Park
2025-06-25 22:24 ` Honggyu Kim
2025-06-26 15:27 ` SeongJae Park
2025-06-27 11:29 ` Honggyu Kim
2025-06-22 12:09 ` [PATCH 2/3] samples/damon: change enable parameters to enabled Honggyu Kim
2025-06-22 16:14 ` SeongJae Park
2025-06-23 3:04 ` Honggyu Kim
2025-06-22 12:09 ` [PATCH 3/3] samples/damon: fix bugs for damon sample for start failures Honggyu Kim
2025-06-22 16:29 ` SeongJae Park [this message]
2025-06-23 3:16 ` Honggyu Kim
2025-06-23 18:11 ` SeongJae Park
2025-06-25 22:27 ` Honggyu Kim
2025-06-26 15:28 ` SeongJae Park
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=20250622162935.51108-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=honggyu.kim@sk.com \
--cc=kernel_team@skhynix.com \
--cc=linux-mm@kvack.org \
--cc=yunjeong.mun@sk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).