Skip to content

mm/damon/sysfs: support periodic and automated stats update

SeongJae Park damon linux-doc linux-mm lkml 1 version Applied

Status from this message: [merged mm-stable] docs-abi-damon-update-for-refresh_ms.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesApplied 4/4

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4mm/damon/sysfs: implement refresh_ms file under kdamond directorymm/damon/sysfs.c+29 -00 repliesApplied
2/4mm/damon/sysfs: implement refresh_ms file internal workmm/damon/sysfs.c+29 -00 repliesApplied
3/4Docs/admin-guide/mm/damon/usage: document refresh_ms fileDocumentation/admin-guide/mm/damon/usage.rst+10 -30 repliesApplied
4/4Docs/ABI/damon: update for refresh_msDocumentation/ABI/testing/sysfs-kernel-mm-damon+7 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update

DAMON sysfs interface provides files for reading DAMON internal status including auto-tuned monitoring intervals, DAMOS stats, DAMOS action applied regions, and auto-tuned DAMOS effective quota. Among those, auto-tuned monitoring intervals, DAMOS stats and auto-tuned DAMOS effective quota are essential for common DAMON/S use cases.

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 update of the above mentioned essential contents 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. In other words, it is similar to periodically writing 'update_schemes_stats', 'update_schemes_effective_quotas', and 'update_tuned_intervals' keywords to the 'state' file. If zero is written to the file, the automatic refresh is disabled.

Changes from RFC
(https://lore.kernel.or/[email protected])
- Wordsmith cover letter to clarify what are updated

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: 2951e548fd2e489bdaecf326e1c3d17d4b5663fe

Signature · 1 line
2.39.5