Skip to contentSkip to conversation

mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()

PATCH Applied Liew Rui Yan 4 participants 7 messages Jul 20 – Jul 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/damon/reclaim: fix typo in damon_reclaim_timer_fn()

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 <[email protected]> # 6.1.x
---
 mm/damon/reclaim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/damon/reclaim.c +1 -1
index 016cd8d83ca9..bb4b705d842c 100644
@@ -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);
 }
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 10 lines · Liew Rui Yan

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

#2 lore raw

Hi Greg,

Quoted 2 lines · Greg KH

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

maintainer
#3 lore raw
Quoted 15 lines · Liew Rui Yan

Hi Greg,

Quoted 2 lines · Greg KH

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.

Quoted 6 lines
    $ 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

maintainer
#4 lore raw
Quoted 7 lines · On Mon, 20 Jul 2026 13:53:10 +0200 Greg KH <[email protected]> wrote:
Quoted 6 lines · Liew Rui Yan

Hi Greg,

Quoted 2 lines · Greg KH

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.

Quoted 5 lines
Quoted 5 lines

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.

Quoted 8 lines
Quoted 8 lines

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
Quoted 5 lines
Quoted 2 lines

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

[...]

maintainer Reviewed-by on v1 1/1
#5 lore raw
In reply to Liew Rui Yan
Quoted 8 lines · On Mon, 20 Jul 2026 17:47:08 +0800 Liew Rui Yan <[email protected]>…

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!

Quoted 4 lines
Fixes 2f54908fae21 ("mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values")
Cc <[email protected]> # 6.1.x
Quoted 1 line

Thanks,
SJ

[...]

maintainer Applied
#6 lore raw
In reply to Liew Rui Yan
Quoted 3 lines

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.

Signature · 2 lines
Thanks,
Sasha