Re: [PATCH] mm/damon: support freeze kdamond
From: SJ Park
Date: Wed Nov 25 2026 - 00:00:41 EST
Hello linruifeng,
I was thinking how DAMON would work under hibernation, and recalled this
thread.
On Thu, 9 Apr 2026 07:06:08 -0700 SeongJae Park <sj@xxxxxxxxxx> wrote:
> On Thu, 9 Apr 2026 15:20:10 +0800 "linruifeng (A)" <linruifeng4@xxxxxxxxxx> wrote:
[...]
> I feel like it is reasonable but I'd love it more if there are more concrete
> examples and/or observations that support this.
I now understand following problem could happen in theory. If DAMOS is
configured, it could migrate or reclaim pages while hibernation image is being
copied. It could make the image be corrupted. As a result, the system could
run with corrupted memory after resuming from the hibernation.
Users could work around by stopping or pausing the kdamond before hibernation
is started. But it is easy to forget and cumbersome.
So I think your patch is better to be added.
Nonetheless, I think you should replace kthread_should_stop() with
kthread_freezable_should_stop(), Otherwise, it could have kthread_stop() /
freezer deadlock. By doing that, try_to_freeze() call wouldn't be necessary.
Would you mind posting this patch again, with the above elaborations and
changes? If you don't reply in about a couple of days, I will do that on my
own. In the case, I will add your credit with Suggested-by: tag.
Thanks,
SJ
[...]