Re: [PATCH] mm/damon/core: do not overwrite wmarks.activated in damos_commit()

From: Yifan Feng

Date: Sun Nov 22 2026 - 18:47:01 EST


On Sat, 21 Nov 2026 17:22:22 -0800 SJ Park <sj@xxxxxxxxxx> wrote:

[...]
> > Do not restore
> > it for DAMOS_WMARK_NONE, because nothing sets it again in that case and
> > the scheme would stay off.
>
> Is this really necessary? If not, I'd prefer restoring it always for
> simplicity.

Thanks for the quick review.

I think it is needed. With DAMOS_WMARK_NONE, damos_wmark_wait_us()
returns 0 before it touches 'activated'. So if the scheme is
deactivated when the metric is changed to none, nothing activates it
again.

I tried restoring it always. I deactivated a scheme by the watermarks
(free memory rate above high), then set the metric to none and
committed. After that update_schemes_tried_regions never returned on
my test kernel (it does not have the damos_walk() fix yet). With the
check, the scheme is applied again after the commit.

Thanks,
Yifan