linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update
@ 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
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: SeongJae Park @ 2025-07-12 20:46 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, Jonathan Corbet, damon, kernel-team,
	linux-doc, linux-kernel, linux-mm

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.  If non-zero value is written to the file, DAMON sysfs
interface does the updates for essential DAMON internal status including
auto-tuned monitoring intervals, DAMOS stats, and auto-tuned DAMOS
quotas using the user-written value as the time delay.  If zero is
written to the file, the automatic refresh is disabled.

SeongJae Park (4):
  mm/damon/sysfs: implement refresh_ms file under kdamond directory
  mm/damon/sysfs: implement refresh_ms file internal work
  Docs/admin-guide/mm/damon/usage: document refresh_ms file
  Docs/ABI/damon: update for refresh_ms

 .../ABI/testing/sysfs-kernel-mm-damon         |  7 +++
 Documentation/admin-guide/mm/damon/usage.rst  | 13 ++++-
 mm/damon/sysfs.c                              | 58 +++++++++++++++++++
 3 files changed, 75 insertions(+), 3 deletions(-)


base-commit: 982b86e9191292ffcd0f30018981cb16f9fac5c1
-- 
2.39.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-16  5:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 20:46 [RFC PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update 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
2025-07-16  1:58     ` Honggyu Kim
2025-07-16  2:51       ` SeongJae Park
2025-07-16  5:18         ` Honggyu Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).