From: SeongJae Park <sj@kernel.org>
To: "linruifeng (A)" <linruifeng4@huawei.com>
Cc: SeongJae Park <sj@kernel.org>,
akpm@linux-foundation.org, chenjun102@huawei.com,
tongtiangen@huawei.com, damon@lists.linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon: support freeze kdamond
Date: Thu, 9 Apr 2026 07:06:08 -0700 [thread overview]
Message-ID: <20260409140609.59881-1-sj@kernel.org> (raw)
In-Reply-To: <1b340c6e-4e21-42c3-a1b1-d07813b8b8b7@huawei.com>
On Thu, 9 Apr 2026 15:20:10 +0800 "linruifeng (A)" <linruifeng4@huawei.com> wrote:
> Hello SJ,
>
> Thank you for your reply. Based on my current knowledge, I think this can be
> described from three aspects:
>
> 1、kdamond monitors physical/virtual addresses and performs certain
> actions based
> on the monitoring results to improve system/process efficiency. When the
> system
> undergoes suspend/resume, most user-space processes are in a suspended
> state.
> kdamond may therefore perform operations such as PAGEOUT /
> MADV_NOHUGEPAGE, but
> these are not true data monitoring results. This may cause changes in
> the efficiency
> of certain processes after system resume. Therefore, I believe that
> continuing to
> run kdamond during suspend is meaningless and may even have negative
> effects.
>
> 2、When performing hibernate, most of the used memory in the system is
> swapped out to
> disk. When memory is large, this is time-consuming. If kdamond does not
> sleep, it may
> affect hibernate efficiency.
Sounds making sense, but I'm failing at finding some specific problematic case
and expecting the real impact. Can you share a concrete problematic scenario
example with an expectation of the impact? Also, is this just a theoretical
concern? Or, a real issue that you find from your real DAMON use case? If
this is finding from a real use case, could you addd more details about the
observation?
>
> 3、As discussed in [1]:
Seems you forgot adding a link?
> "The principal reason is to prevent filesystems
> from being damaged
> after hibernation. At the moment we have no simple means of
> checkpointing filesystems, so if
> there are any modifications made to filesystem data and/or metadata on
> disks, we cannot bring
> them back to the state from before the modifications. At the same time
> each hibernation image
> contains some filesystem-related information that must be consistent
> with the state of the on
> disk data and metadata after the system memory state has been restored
> from the image (otherwise
> the filesystems will be damaged in a nasty way, usually making them
> almost impossible to repair).
> We therefore freeze tasks that might cause the on-disk filesystems' data
> and metadata to be modified
> after the hibernation image has been created and before the system is
> finally powered off. The majority
> of these are user space processes, but if any of the kernel threads may
> cause something like this to
> happen, they have to be freezable." During suspend/resume, processes
> involving I/O operations should
> be frozen.
But what file system changes DAMON could make? Could you please add more
detailed scenarios and expectation or observation of the impact?
>
> Based on the above reasons, I believe it is reasonable to support
> freezing kdamond. If there are any
> errors in my thinking, please point them out.
I feel like it is reasonable but I'd love it more if there are more concrete
examples and/or observations that support this.
Thanks,
SJ
[...]
prev parent reply other threads:[~2026-04-09 14:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 8:06 Lin Ruifeng
2026-04-08 14:07 ` SeongJae Park
2026-04-09 7:00 ` linruifeng (A)
2026-04-09 7:20 ` linruifeng (A)
2026-04-09 14:06 ` SeongJae Park [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260409140609.59881-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chenjun102@huawei.com \
--cc=damon@lists.linux.dev \
--cc=linruifeng4@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tongtiangen@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox