Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Liew Rui Yan <aethernet65535@gmail.com>
Cc: SJ Park <sj@kernel.org>, damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm/damon/reclaim: add 'available' memory as an optional watermarks metric
Date: Sat, 27 Jun 2026 15:26:43 -0700	[thread overview]
Message-ID: <20260627222645.26834-1-sj@kernel.org> (raw)
In-Reply-To: <20260627213651.19000-1-aethernet65535@gmail.com>

On Sun, 28 Jun 2026 05:36:50 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:

> 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.

Ah, you are correct.

> By "drops",
> do you mean the age information becomes stale/unreliable during the
> inactive period rather than being literally discarded?

I was just wrongly recall the detail ;)  But, yes, your representation is
correct and much better.

> 
> > 
> > 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’).

For explicit DAMOS-only pause/resume, you may also be interested in
max_nr_snapshots [1] feature.

> 
> 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.

I don't recall that mail.  Did you send that to damon@lists.linux.dev or other
public mailing lists?  If so, could you share the message id or lore.kernel.org
link of the mail?  If not, could you please resend?

[1] https://lkml.kernel.org/r/20251216080128.42991-8-sj@kernel.org


Thanks,
SJ

[...]


      reply	other threads:[~2026-06-27 22:26 UTC|newest]

Thread overview: 4+ 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 14:18 ` SeongJae Park
2026-06-27 21:36   ` Liew Rui Yan
2026-06-27 22:26     ` SJ 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=20260627222645.26834-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox