linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Honggyu Kim <honggyu.kim@sk.com>
Cc: SeongJae Park <sj@kernel.org>,
	kernel_team@skhynix.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	damon@lists.linux.dev, kernel-team@meta.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update
Date: Tue, 15 Jul 2025 16:43:16 -0700	[thread overview]
Message-ID: <20250715234316.91272-1-sj@kernel.org> (raw)
In-Reply-To: <923d9fe1-b959-4fba-9da7-10d2b3126858@sk.com>

On Wed, 16 Jul 2025 07:20:57 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:

> Hi SeongJae,
> 
> On 7/13/2025 5:46 AM, SeongJae Park wrote:
> > DAMON sysfs interface provides files for reading DAMON internal status
> > including DAMOS stats.  The content of the files are not automatically
> > updated, though.  Users should manually request updates of the contents
> > by writing a special command to 'state' file of each kdamond directory.
> > This interface is good for minimizing overhead, but causes the below
> > problems.
> > 
> > First, the usage is cumbersome.  This is arguably not a big problem,
> > since the user-space tool (damo) can do this instead of the user.
> > 
> > Second, it can be too slow.  The update request is not directly handled
> > by the sysfs interface but kdamond thread.  And kdamond threads wake up
> > only once per the sampling interval.  Hence if sampling interval is not
> > short, each update request could take too long time.  The recommended
> > sampling interval setup is asking DAMON to automatically tune it, within
> > a range between 5 milliseconds and 10 seconds.  On production systems it
> > is not very rare to have a few seconds sampling interval as a result of
> > the auto-tuning, so this can disturb observing DAMON internal status.
> > 
> > Finally, parallel update requests can conflict with each other.  When
> > parallel update requests are received, DAMON sysfs interface simply
> > returns -EBUSY to one of the requests.  DAMON user-space tool is hence
> > implementing its own backoff mechanism, but this can make the operation
> > even slower.
> > 
> > Introduce a new sysfs file, namely refresh_ms, for asking DAMON sysfs
> > interface to repeat the essential contents update with a user-specified
> > time delay.
> 
> Thanks for working on this, but I have a few questions.
> 1. Could you please list up what are the "essential contents"?

Thank you for asking this.  The contents are auto-tuned monitoring intervals,
DAMOS stats, and auto-tuned effective size quota.

I will add these on the next version cover letter.

> 2. Does it mean that it is different from writing "commit" to "state"?
> 3. If not, then is there equivalent action to writing something to "state"?

"refresh_ms" works same to other DAMON parameter files.  You can set it before
starting DAMON, or "commit" new values (including 0 for turning this refresh
off) in runtime.

I'm not that confident if I understood your point very well, especially what
"it"s mean.  Let me know if I'm misunderstanding something.

> 
> If possible, then this kind of information is better to be documented because
> users might get confused if something isn't udpated when "refresh_ms" is set.

You're right!  I'll add above things on the next version of the cover letter.


Thanks,
SJ

[...]


  reply	other threads:[~2025-07-15 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-12 20:46 SeongJae Park
2025-07-12 20:46 ` [RFC PATCH 1/4] mm/damon/sysfs: implement refresh_ms file under kdamond directory SeongJae Park
2025-07-12 20:46 ` [RFC PATCH 2/4] mm/damon/sysfs: implement refresh_ms file internal work SeongJae Park
2025-07-12 20:46 ` [RFC PATCH 3/4] Docs/admin-guide/mm/damon/usage: document refresh_ms file SeongJae Park
2025-07-12 20:46 ` [RFC PATCH 4/4] Docs/ABI/damon: update for refresh_ms SeongJae Park
2025-07-15 22:20 ` [RFC PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update Honggyu Kim
2025-07-15 23:43   ` SeongJae Park [this message]
2025-07-16  1:58     ` Honggyu Kim
2025-07-16  2:51       ` SeongJae Park
2025-07-16  5:18         ` Honggyu Kim

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=20250715234316.91272-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=damon@lists.linux.dev \
    --cc=honggyu.kim@sk.com \
    --cc=kernel-team@meta.com \
    --cc=kernel_team@skhynix.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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