Re: [PATCH] mm/damon/core: do not overwrite wmarks.activated in damos_commit()
From: SJ Park
Date: Sun Nov 22 2026 - 19:02:00 EST
On Sat, 21 Nov 2026 16:29:30 -0800 Yifan Feng <evanfengff@xxxxxxxxx> wrote:
> damos_commit() copies the whole wmarks struct from the source scheme,
> including the private 'activated' field. The source scheme is a new
> one, so the field is always true there.
>
> As a result, a commit turns on a scheme that the watermarks turned off.
> If the metric is between mid and high at that time, the scheme keeps
> running, though it should stay off until the metric goes below mid.
> DAMON_RECLAIM and DAMON_LRU_SORT use the same path for commit_inputs.
>
> Save 'activated' before the copy and restore it after. Do not restore
> it for DAMOS_WMARK_NONE, because nothing sets it again in that case and
> the scheme would stay off.
>
> Fixes: 9cb3d0b9dfce ("mm/damon/core: implement DAMON context commit function")
> Cc: <stable@xxxxxxxxxxxxxxx> # 6.11.x
> Signed-off-by: Yifan Feng <evanfengff@xxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
This patch is applied to damon/next [1] tree. I will repost it soon (~1 week)
as an mm.git merge request. So, no action from your side is needed for now.
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]