All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liew Rui Yan <aethernet65535@gmail.com>
To: sj@kernel.org
Cc: aethernet65535@gmail.com, damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm/damon/reclaim: add 'available' memory as an optional watermarks metric
Date: Sun, 28 Jun 2026 05:36:50 +0800	[thread overview]
Message-ID: <20260627213651.19000-1-aethernet65535@gmail.com> (raw)
In-Reply-To: <20260626141819.86269-1-sj@kernel.org>

Hi SeongJae,

On Fri, 26 Jun 2026 07:18:18 -0700 SeongJae Park <sj@kernel.org> wrote:

> How about using DAMOS quota with its aim-based auto-tuning, instead?
> 
> I developed DAMOS watermarks and quota as safe guards of DAMOS.  In more
> detail, DAMOS quota is for restricting only resource usage of DAMOS.
> Meanwhile, watermarks is for restricting resource usage of both DAMON and
> DAMOS.  That is, when the watermarks condition is met, not only DAMOS but also
> DAMON is completely paused.  Also, watermarks feature was considered smarter
> than quota, because it is a kind of auto-tuning.
> 
> However, it turned out completely turning DAMON off is not a very good idea,
> because it drops monitoring results when the watermarks condition is met and
> therefore completely stops DAMON and DAMOS.  It drops the region shapes and
> 'age' information.  Especially, 'age' of some regions commonly cumulated up to
> hours or even days.  Dropping that was a problem in production use cases.

I looked at the code and noticed that kdamond_wait_activation()
doesn't seem to free the regions, the data remains in memory. By "drops",
do you mean the age information becomes stale/unreliable during the
inactive period rather than being literally discarded?

> 
> Meanwhile, we introduced aim-oriented DAMOS quota auto-tuning (a.k.a DAMOS
> quota goal).  It made DAMOS quota smarter and easier to extend than watermarks.
> Nowadays, users can also pause and resume [1] DAMON/DAMOS without losing the
> monitoring information when they want.
> 
> So, I personally don't encourage people to use watermarks.  Of course, I may
> missing some problems in alternatives.  Hence I'm asking the question to you.
> 
> How about using DAMOS quota with its aim-based auto-tuning, instead?  If you
> cannot, could you share more details?
> 
> I'll hold reviewing the code until this high level discussion is resolved.
> 
> [1] https://lore.kernel.org/20260427151231.113429-1-sj@kernel.org

Thank you for the detailed explanation. I now understand that watermarks
pause the entire DAMON monitoring loop rather than just gating DAMOS
actions. I agree this makes watermarks unsuitable for the Android use
case I described.

I will drop this patch. I think controlling DAMOS pause/rusume
separately might be better suited for execution in user space (such as
controlling‘quota_ms’ and ‘quota_sz’).

By the way, I sent you an email about three weeks ago (Fri, 5 Jun 2026
20:28:00 +0800) introducing a userspace auto-tuner program I wrote for
DAMON_RECLAIM's 'min_age', and asking for your thoughts. I am not sure
if it reached you, could you please check? I would really appreciate
your feedback on that as well.

Best regards,
Rui Yan


  reply	other threads:[~2026-06-27 21:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26  8:10 [RFC PATCH] mm/damon/reclaim: add 'available' memory as an optional watermarks metric Liew Rui Yan
2026-06-26  8:24 ` sashiko-bot
2026-06-26 14:18 ` SeongJae Park
2026-06-27 21:36   ` Liew Rui Yan [this message]
2026-06-27 22:26     ` SJ Park

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=20260627213651.19000-1-aethernet65535@gmail.com \
    --to=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.