* [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
@ 2026-07-20 9:47 Liew Rui Yan
2026-07-20 9:59 ` Greg KH
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Liew Rui Yan @ 2026-07-20 9:47 UTC (permalink / raw)
To: SJ Park; +Cc: damon, linux-mm, Liew Rui Yan, stable, Yikai Zhao
Commit 2f54908fae211 ("mm/damon/reclaim: detect and use fresh enabled
and kdamond_pid values") introduced a typo in damon_reclaim_timer_fn()
where '!=' was used instead of '==' (unlike damon_lru_sort_timer_fn()).
This caused damon_reclaim to return early during the delayed work,
breaking early boot parameter configuration like
'damon_reclaim.enabled=Y'.
Fix this by changing '!=' to '=='.
Fixes: 2f54908fae21 ("mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values")
Cc: <stable@vger.kernel.org> # 6.1.x
Reported-by: Yikai Zhao <yikai@z1k.dev>
Signed-off-by: Liew Rui Yan <aethernet65535@gmail.com>
---
mm/damon/reclaim.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index 016cd8d83ca9..bb4b705d842c 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -198,7 +198,7 @@ static void damon_reclaim_timer_fn(struct work_struct *work)
bool now_enabled;
now_enabled = enabled;
- if (damon_reclaim_enabled() != now_enabled)
+ if (damon_reclaim_enabled() == now_enabled)
return;
damon_reclaim_turn(now_enabled);
}
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 9:47 [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn() Liew Rui Yan
@ 2026-07-20 9:59 ` Greg KH
2026-07-20 11:02 ` Liew Rui Yan
2026-07-20 15:38 ` SJ Park
2026-07-21 0:56 ` Sasha Levin
2 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2026-07-20 9:59 UTC (permalink / raw)
To: Liew Rui Yan; +Cc: SJ Park, damon, linux-mm, stable, Yikai Zhao
On Mon, Jul 20, 2026 at 05:47:08PM +0800, Liew Rui Yan wrote:
> Commit 2f54908fae211 ("mm/damon/reclaim: detect and use fresh enabled
> and kdamond_pid values") introduced a typo in damon_reclaim_timer_fn()
> where '!=' was used instead of '==' (unlike damon_lru_sort_timer_fn()).
> This caused damon_reclaim to return early during the delayed work,
> breaking early boot parameter configuration like
> 'damon_reclaim.enabled=Y'.
>
> Fix this by changing '!=' to '=='.
>
> Fixes: 2f54908fae21 ("mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values")
Why is this a stable-only patch? Did something go wrong with the
backport of this commit that is not in the upstream version?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 9:59 ` Greg KH
@ 2026-07-20 11:02 ` Liew Rui Yan
2026-07-20 11:53 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Liew Rui Yan @ 2026-07-20 11:02 UTC (permalink / raw)
To: gregkh; +Cc: aethernet65535, damon, linux-mm, sj, stable, yikai
Hi Greg,
On Mon, 20 Jul 2026 11:59:03 +0200, Greg KH wrote:
> Why is this a stable-only patch? Did something go wrong with the
> backport of this commit that is not in the upstream version?
Sorry for the confusion!
This is a stable-only patch because this specific function was removed
in mainline starting from v6.2.
Therefore, this bug only affects v6.1.176 and v6.1.177 stable branches.
Mainline does not have this function anymore.
$ git tag --contains 2f54908fae21
v6.1.176
v6.1.177
Let me know if you want me to resend with this explanation
explicitly noted in the commit message.
Best regards,
Rui Yan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 11:02 ` Liew Rui Yan
@ 2026-07-20 11:53 ` Greg KH
2026-07-20 15:33 ` SJ Park
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2026-07-20 11:53 UTC (permalink / raw)
To: Liew Rui Yan; +Cc: damon, linux-mm, sj, stable, yikai
On Mon, Jul 20, 2026 at 07:02:32PM +0800, Liew Rui Yan wrote:
> Hi Greg,
>
> On Mon, 20 Jul 2026 11:59:03 +0200, Greg KH wrote:
>
> > Why is this a stable-only patch? Did something go wrong with the
> > backport of this commit that is not in the upstream version?
>
> Sorry for the confusion!
>
> This is a stable-only patch because this specific function was removed
> in mainline starting from v6.2.
>
> Therefore, this bug only affects v6.1.176 and v6.1.177 stable branches.
> Mainline does not have this function anymore.
>
> $ git tag --contains 2f54908fae21
> v6.1.176
> v6.1.177
>
> Let me know if you want me to resend with this explanation
> explicitly noted in the commit message.
Why can't we just take the same commits that are upstream that prevent
this issue from happening?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 11:53 ` Greg KH
@ 2026-07-20 15:33 ` SJ Park
0 siblings, 0 replies; 7+ messages in thread
From: SJ Park @ 2026-07-20 15:33 UTC (permalink / raw)
To: Greg KH; +Cc: SJ Park, Liew Rui Yan, damon, linux-mm, stable, yikai
On Mon, 20 Jul 2026 13:53:10 +0200 Greg KH <gregkh@linuxfoundation.org> wrote:
> On Mon, Jul 20, 2026 at 07:02:32PM +0800, Liew Rui Yan wrote:
> > Hi Greg,
> >
> > On Mon, 20 Jul 2026 11:59:03 +0200, Greg KH wrote:
> >
> > > Why is this a stable-only patch? Did something go wrong with the
> > > backport of this commit that is not in the upstream version?
You are correct. The typo was introduced by a mistake during the porting. The
upstream commit (64a140afa5ed) doesn't have the typo. This patch fixes the
typo.
> >
> > Sorry for the confusion!
> >
> > This is a stable-only patch because this specific function was removed
> > in mainline starting from v6.2.
It is true the function is removed in the mainline. But that's not the reason
why we need this patch applied to only 6.1. The reason is that the porting
introduced a bug.
> >
> > Therefore, this bug only affects v6.1.176 and v6.1.177 stable branches.
> > Mainline does not have this function anymore.
> >
> > $ git tag --contains 2f54908fae21
> > v6.1.176
> > v6.1.177
> >
> > Let me know if you want me to resend with this explanation
> > explicitly noted in the commit message.
>
> Why can't we just take the same commits that are upstream that prevent
> this issue from happening?
We can't do so because the typo is only in the stable kernel.
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 9:47 [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn() Liew Rui Yan
2026-07-20 9:59 ` Greg KH
@ 2026-07-20 15:38 ` SJ Park
2026-07-21 0:56 ` Sasha Levin
2 siblings, 0 replies; 7+ messages in thread
From: SJ Park @ 2026-07-20 15:38 UTC (permalink / raw)
To: Liew Rui Yan; +Cc: SJ Park, damon, linux-mm, stable, Yikai Zhao
On Mon, 20 Jul 2026 17:47:08 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:
> Commit 2f54908fae211 ("mm/damon/reclaim: detect and use fresh enabled
> and kdamond_pid values") introduced a typo in damon_reclaim_timer_fn()
> where '!=' was used instead of '==' (unlike damon_lru_sort_timer_fn()).
> This caused damon_reclaim to return early during the delayed work,
> breaking early boot parameter configuration like
> 'damon_reclaim.enabled=Y'.
>
> Fix this by changing '!=' to '=='.
Thank you for quickly fixing this!
>
> Fixes: 2f54908fae21 ("mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values")
> Cc: <stable@vger.kernel.org> # 6.1.x
> Reported-by: Yikai Zhao <yikai@z1k.dev>
Closes: https://lore.kernel.org/CANMyjpgq5n0Ekt4dgyLRHGb89_Ew0aOMZ3j32V_w0GjHkqH1FQ@mail.gmail.com
> Signed-off-by: Liew Rui Yan <aethernet65535@gmail.com>
Reviewed-by: SJ Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()
2026-07-20 9:47 [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn() Liew Rui Yan
2026-07-20 9:59 ` Greg KH
2026-07-20 15:38 ` SJ Park
@ 2026-07-21 0:56 ` Sasha Levin
2 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-07-21 0:56 UTC (permalink / raw)
To: SJ Park; +Cc: Sasha Levin, damon, linux-mm, Liew Rui Yan, stable, Yikai Zhao
> Commit 2f54908fae211 ("mm/damon/reclaim: detect and use fresh enabled
> and kdamond_pid values") introduced a typo in damon_reclaim_timer_fn()
> where '!=' was used instead of '==' (unlike damon_lru_sort_timer_fn()).
Queued for 6.1, thanks.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-21 0:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 9:47 [PATCH] mm/damon/reclaim: fix typo in damon_reclaim_timer_fn() Liew Rui Yan
2026-07-20 9:59 ` Greg KH
2026-07-20 11:02 ` Liew Rui Yan
2026-07-20 11:53 ` Greg KH
2026-07-20 15:33 ` SJ Park
2026-07-20 15:38 ` SJ Park
2026-07-21 0:56 ` Sasha Levin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.