First three patches of the patch series "mm/damon: fix misc bugs in DAMON modules" [1] was trying to fix boot time DAMON sample modules enabling issues by avoiding starting DAMON before the module initialization phase. However, probably by a mistake during a merge, only half of the change is merged, and the part for avoiding the starting of DAMON before the module initialized is missed. So the problem is not solved. Fix those.
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also need to be merged into the stable kernels. Hence Cc-ing stable@.
[1] https://lore.kernel.org/20250706193207.39810-1-sj@kernel.org
SeongJae Park (3): samples/damon/wsse: avoid starting DAMON before initialization samples/damon/prcl: avoid starting DAMON before initialization samples/damon/mtier: avoid starting DAMON before initialization
samples/damon/mtier.c | 3 +++ samples/damon/prcl.c | 3 +++ samples/damon/wsse.c | 3 +++ 3 files changed, 9 insertions(+)
base-commit: 186951910f4e44e20738d85c0421032634ddb298
Commit 0ed1165c3727 ("samples/damon/wsse: fix boot time enable handling") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again.
[1] https://lore.kernel.org/20250706193207.39810-2-sj@kernel.org
Fixes: 0ed1165c3727 ("samples/damon/wsse: fix boot time enable handling") Cc: stable@vger.kernel.org # 6.17-rc1 Signed-off-by: SeongJae Park sj@kernel.org --- samples/damon/wsse.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c index da052023b099..21eaf15f987d 100644 --- a/samples/damon/wsse.c +++ b/samples/damon/wsse.c @@ -118,6 +118,9 @@ static int damon_sample_wsse_enable_store( return 0;
if (enabled) { + if (!init_called) + return 0; + err = damon_sample_wsse_start(); if (err) enabled = false;
Commit 2780505ec2b4 ("samples/damon/prcl: fix boot time enable crash") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again.
[1] https://lore.kernel.org/20250706193207.39810-3-sj@kernel.org
Fixes: 2780505ec2b4 ("samples/damon/prcl: fix boot time enable crash") Cc: stable@vger.kernel.org # 6.17-rc1 Signed-off-by: SeongJae Park sj@kernel.org --- samples/damon/prcl.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 1b839c06a612..0226652f94d5 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -137,6 +137,9 @@ static int damon_sample_prcl_enable_store( if (enabled == is_enabled) return 0;
+ if (!init_called) + return 0; + if (enabled) { err = damon_sample_prcl_start(); if (err)
Commit 964314344eab ("samples/damon/mtier: support boot time enable setup") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again.
[1] https://lore.kernel.org/20250706193207.39810-4-sj@kernel.org
Fixes: 964314344eab ("samples/damon/mtier: support boot time enable setup") Cc: stable@vger.kernel.org # 6.17-rc1 Signed-off-by: SeongJae Park sj@kernel.org --- samples/damon/mtier.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index 7ebd352138e4..beaf36657dea 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -208,6 +208,9 @@ static int damon_sample_mtier_enable_store( if (enabled == is_enabled) return 0;
+ if (!init_called) + return 0; + if (enabled) { err = damon_sample_mtier_start(); if (err)
On Mon, 8 Sep 2025 19:22:35 -0700 SeongJae Park sj@kernel.org wrote:
First three patches of the patch series "mm/damon: fix misc bugs in DAMON modules" [1] was trying to fix boot time DAMON sample modules enabling issues by avoiding starting DAMON before the module initialization phase. However, probably by a mistake during a merge, only half of the change is merged, and the part for avoiding the starting of DAMON before the module initialized is missed. So the problem is not solved. Fix those.
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also need to be merged into the stable kernels. Hence Cc-ing stable@.
That's unfortunate, but the about doesn't actually tell us what this series does.
[1] https://lore.kernel.org/20250706193207.39810-1-sj@kernel.org
Presumably it's in there somewhere?
On Mon, 8 Sep 2025 19:35:48 -0700 Andrew Morton akpm@linux-foundation.org wrote:
On Mon, 8 Sep 2025 19:22:35 -0700 SeongJae Park sj@kernel.org wrote:
First three patches of the patch series "mm/damon: fix misc bugs in DAMON modules" [1] was trying to fix boot time DAMON sample modules enabling issues by avoiding starting DAMON before the module initialization phase. However, probably by a mistake during a merge, only half of the change is merged, and the part for avoiding the starting of DAMON before the module initialized is missed. So the problem is not solved. Fix those.
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also need to be merged into the stable kernels. Hence Cc-ing stable@.
That's unfortunate, but the about doesn't actually tell us what this series does.
Good point. The issue is that the sample modules can crash if those are enabled at boot time before DAMON is initialized, via kernel command line.
Would you prefer me sending another version of this patch series with an elaborated cover letter?
[1] https://lore.kernel.org/20250706193207.39810-1-sj@kernel.org
Presumably it's in there somewhere?
You're right. Both the cover letter and the individual fix patches (first three of the series) describes the issue and origin broken commit.
Please let me know if there is anything I can help for this patch series from my side :)
Thanks, SJ
On Mon, 8 Sep 2025 20:51:41 -0700 SeongJae Park sj@kernel.org wrote:
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also need to be merged into the stable kernels. Hence Cc-ing stable@.
That's unfortunate, but the about doesn't actually tell us what this series does.
Good point. The issue is that the sample modules can crash if those are enabled at boot time before DAMON is initialized, via kernel command line.
Would you prefer me sending another version of this patch series with an elaborated cover letter?
Please just send out the appropriate words and I'll paste it in.
On Mon, 8 Sep 2025 21:18:45 -0700 Andrew Morton akpm@linux-foundation.org wrote:
On Mon, 8 Sep 2025 20:51:41 -0700 SeongJae Park sj@kernel.org wrote:
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also need to be merged into the stable kernels. Hence Cc-ing stable@.
That's unfortunate, but the about doesn't actually tell us what this series does.
Good point. The issue is that the sample modules can crash if those are enabled at boot time before DAMON is initialized, via kernel command line.
Would you prefer me sending another version of this patch series with an elaborated cover letter?
Please just send out the appropriate words and I'll paste it in.
Thank you for the guidance, Andrew. How about below?
""" First three patches of the patch series "mm/damon: fix misc bugs in DAMON modules" [1] was trying to fix boot time DAMON sample modules enabling issues. The issues are the modules can crash if those are enabled before DAMON is enabled, like using boot time parameter options. The three patches were fixing the issues by avoiding starting DAMON before the module initialization phase.
However, probably by a mistake during a merge, only half of the change is merged, and the part for avoiding the starting of DAMON before the module initialized is missed. So the problem is not solved and thus the modules can still crash if enabled before DAMON is initialized. Fix those by applying the unmerged parts again.
Note that the broken commits are merged into 6.17-rc1, but also backported to relevant stable kernels. So this series also needs to be merged into the stable kernels. Hence Cc-ing stable@. """
Thanks, SJ
linux-stable-mirror@lists.linaro.org