Skip to content

RFC mm/damon: extend DAMOS filters for inclusion of target memory

SeongJae Park damon linux-doc linux-mm lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest10 patches 0 repliesNew
  2. v1 RFC10 patches 1 replySuperseded

Changes in v2 from the cover letter

(https://lore.kernel.org/[email protected])
- Fix encoding issue on the last patch

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10mm/damon: fixup damos_filter kernel-docinclude/linux/damon.h+6 -50 replies
2/10mm/damon/core: add damos_filter->pass fieldinclude/linux/damon.h mm/damon/core.c+4 -10 replies
3/10mm/damon/core: support damos_filter->passmm/damon/core.c mm/damon/tests/core-kunit.h+8 -80 replies
4/10mm/damon/paddr: support damos_filter->passmm/damon/paddr.c+3 -30 replies
5/10mm/damon: add pass argument to damos_new_filter()include/linux/damon.h mm/damon/core.c mm/damon/paddr.c +3 more+11 -90 replies
6/10mm/damon/sysfs-schemes: add a file for setting damos_filter->passmm/damon/sysfs-schemes.c+31 -10 replies
7/10Docs/mm/damon/design: document pass/block filters behaviorsDocumentation/mm/damon/design.rst+25 -40 replies
8/10Docs/ABI/damon: document DAMOS filter pass sysfs fileDocumentation/ABI/testing/sysfs-kernel-mm-damon+10 -40 replies
9/10Docs/admin-guide/mm/damon/usage: omit DAMOS filter details in favor of design docDocumentation/admin-guide/mm/damon/usage.rst+14 -150 replies
10/10Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs fileDocumentation/admin-guide/mm/damon/usage.rst+20 -140 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [RFC PATCH v2 00/10] mm/damon: extend DAMOS filters for inclusion of target memory

DAMOS fitlers are exclusive filters. It only excludes memory of specific types from the DAMOS action targets. This has below problems.

First, the name is not explicitly explaining the behavior. This actually resulted in confusions[1] and works to improve the siaution[2], including wordsmithing documentations and adding features to DAMON user-space tool, damo.

Secondly, the functionality is restrictive. This is especially problematic when multiple filters need to be used. For example, building a DAMOS scheme that applies the action to memory that belongs to cgroup A "or" cgroup B is impossible. A workaroudn is using two schemes, each filtering out memory that not belong to cgroup A and cgroup B, respectively. It is cumbersome, and makes control of quota-like additional factors difficult.

Extend DAMOS filters to support not only excluding (blocking), but also including (pass-through) behavior. For the extension, add a new damos_filter struct field called 'pass' for DAMON kernel API users. Using the API, add a DAMON sysfs file of same name under DAMOS filter sysfs directory, for DAMON user-space ABI users. To prevent breaking old users with a behavioral change, set the blocking as the default behavior.

Note that DAMOS' default behavior without DAMOS filters is applying the action to any memory. And DAMOS filters work for only memory that satisfies 'type' and 'matching'. Hence installing pass filter without any block filter after them makes no filter-behavioral change.

[1] https://lore.kernel.org/[email protected]
[2] https://git.kernel.org/sj/damo/c/b6a722c85ff91e5abe9dd47135e300df243da056

Changes from RFC v1
(https://lore.kernel.org/[email protected])
- Fix encoding issue on the last patch

SeongJae Park (10):
mm/damon: fixup damos_filter kernel-doc
mm/damon/core: add damos_filter->pass field
mm/damon/core: support damos_filter->pass
mm/damon/paddr: support damos_filter->pass
mm/damon: add pass argument to damos_new_filter() mm/damon/sysfs-schemes: add a file for setting damos_filter->pass Docs/mm/damon/design: document pass/block filters behaviors Docs/ABI/damon: document DAMOS filter pass sysfs file Docs/admin-guide/mm/damon/usage: omit DAMOS filter details in favor of
design doc
Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs
file

 .../ABI/testing/sysfs-kernel-mm-damon         | 14 +++--
 Documentation/admin-guide/mm/damon/usage.rst  | 55 ++++++++++---------
 Documentation/mm/damon/design.rst             | 29 ++++++++--
 include/linux/damon.h                         | 15 +++--
 mm/damon/core.c                               | 12 ++--
 mm/damon/paddr.c                              |  9 +--
 mm/damon/reclaim.c                            |  2 +-
 mm/damon/sysfs-schemes.c                      | 32 ++++++++++-
 mm/damon/tests/core-kunit.h                   | 14 ++---
 9 files changed, 125 insertions(+), 57 deletions(-)
Signature · 1 line
2.39.5