Skip to content

RFC mm/damon: support pin-point targets removal

SeongJae Park damon linux-doc linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm/damon/core: add damon_target->obsolete for pin-point removalinclude/linux/damon.h mm/damon/core.c+15 -12 replies
2/5mm/damon/sysfs: test commit input against realistic destinationmm/damon/sysfs.c+21 -10 replies
3/5mm/damon/sysfs: implement obsolete_target filemm/damon/sysfs.c+29 -00 replies
4/5Docs/admin-guide/mm/damon/usage: document obsolete_target fileDocumentation/admin-guide/mm/damon/usage.rst+10 -30 replies
5/5Docs/ABI/damon: document obsolete_target sysfs fileDocumentation/ABI/testing/sysfs-kernel-mm-damon+7 -00 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchBijan Tabatabai
1/5R-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/5] mm/damon: support pin-point targets removal

DAMON maintains the targets in a list, and allows committing only and entire list of targets having new parameters. Targets having same index on the lists are treated as matching source and destination targets. If an existing target cannot find a matching one in the sources list, the target is removed. This means that there is no way to remove only a specific monitoring target in the middle of the current targets list.

Such pin-point targets removal is really needed in some use cases, though. Monitoring accesses to virtual address spaces of processes that spawned from a same ancestor is one example. If a process of the group is terminated, the user may want to remove the matching DAMON target as soon as possible, to save in-kernel memory usage for the unnecessary target data. The user may also want to do that without turning DAMON off or removing unnecessary targets, to keep the current monitoring results for other active processes.

Extend DAMON kernel API and sysfs ABI to support the pin-point removal in the following way. For API, add a new damon_target field, namely 'obsolete'. If the field on parameters commit source target is set, it means the matching destination target is obsolete. Than the parameters commit logic removes the destination target from the existing targets list. For sysfs ABI, add a new file under target directory, namely 'obsolete_target'. It is connected with the 'obsolete' field of the commit source targets, so internally using the new API.

Bijan Tabatabai ([email protected]) has originally reported this issue, and participated in this solution design on a GitHub issue [1] for DAMON user-space tool.

SeongJae Park (5):
mm/damon/core: add damon_target->obsolete for pin-point removal mm/damon/sysfs: test commit input against realistic destination mm/damon/sysfs: implement obsolete_target file Docs/admin-guide/mm/damon/usage: document obsolete_target file Docs/ABI/damon: document obsolete_target sysfs file

 .../ABI/testing/sysfs-kernel-mm-damon         |  7 +++
 Documentation/admin-guide/mm/damon/usage.rst  | 13 +++--
 include/linux/damon.h                         |  6 +++
 mm/damon/core.c                               | 10 +++-
 mm/damon/sysfs.c                              | 51 ++++++++++++++++++-
 5 files changed, 82 insertions(+), 5 deletions(-)

base-commit: f82c3c7358c244b2ba14dadcae822c8d36cf2163

Signature · 1 line
2.47.3