Skip to content

RFC implement DAMOS filtering for anon pages and

SeongJae Park damon linux-doc linux-kselftest 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 Latest11 patches 0 repliesNew
  2. v1 RFC11 patches 3 repliesSuperseded

Changes in v2 from the cover letter

(https://lore.kernel.org/damon/[email protected]/)
- sysfs: Clean up filters directory from scheme directory cleanup path
- sysfs: Link newly created filter to the scheme
- sysfs: Ignore removed memcg when checking path
- sysfs: Guard 'struct mem_cgroup' access with CONFIG_MEMCG (kernel test robot)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11mm/damon/core: implement damos filterinclude/linux/damon.h mm/damon/core.c+90 -00 replies
2/11mm/damon/paddr: support DAMOS filtersmm/damon/paddr.c+62 -90 replies
3/11mm/damon/reclaim: add a parameter called skip_anon for avoiding anonymous pages reclamationmm/damon/reclaim.c+19 -00 replies
4/11Docs/admin-guide/damon/reclaim: document 'skip_anon' parameterDocumentation/admin-guide/mm/damon/reclaim.rst+9 -00 replies
5/11mm/damon/sysfs-schemes: implement filters directorymm/damon/sysfs-schemes.c+84 -10 replies
6/11mm/damon/sysfs-schemes: implement filter directorymm/damon/sysfs-schemes.c+128 -00 replies
7/11mm/damon/sysfs-schemes: connect filter directory and filters directorymm/damon/sysfs-schemes.c+68 -00 replies
8/11mm/damon/sysfs-schemes: implement scheme filtersmm/damon/sysfs-schemes.c+88 -10 replies
9/11selftests/damon/sysfs: test filters directorytools/testing/selftests/damon/sysfs.sh+29 -00 replies
10/11Docs/admin-guide/mm/damon/usage: document DAMOS filters of sysfsDocumentation/admin-guide/mm/damon/usage.rst+46 -20 replies
11/11Docs/ABI/damon: document scheme filters filesDocumentation/ABI/testing/sysfs-kernel-mm-damon+29 -00 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/11] implement DAMOS filtering for anon pages and

Changes from RFC v1
(https://lore.kernel.org/damon/[email protected]/)
- sysfs: Clean up filters directory from scheme directory cleanup path
- sysfs: Link newly created filter to the scheme
- sysfs: Ignore removed memcg when checking path
- sysfs: Guard 'struct mem_cgroup' access with CONFIG_MEMCG (kernel test robot)

----

DAMOS let users do system operations in a data access pattern oriented way. The data access pattern, which is extracted by DAMON, is somewhat accurate more than what user space could know in many cases. However, in some situation, users could know something more than the kernel about the pattern or some special requirements for some types of memory or processes. For example, some users would have slow swap devices and knows latency-ciritical processes and therefore want to use DAMON-based proactive reclamation (DAMON_RECLAIM) for only non-anonymous pages of non-latency-critical processes.

For such restriction, users could exclude the memory regions from the initial monitoring regions and use non-dynamic monitoring regions update monitoring operations set including fvaddr and paddr. They could also adjust the DAMOS target access pattern. For dynamically changing memory layout and access pattern, those would be not enough.

To help the case, add an interface, namely DAMOS filters, which can be used to avoid the DAMOS actions be applied to specific types of memory, to DAMON kernel API (damon.h). At the moment, it supports filtering anonymous pages and/or specific memory cgroups in or out for each DAMOS scheme.

This patchset adds the support for all DAMOS actions that 'paddr' monitoring operations set supports ('pageout', 'lru_prio', and 'lru_deprio'), and the functionality is exposed via DAMON kernel API (damon.h) the DAMON sysfs interface (/sys/kernel/mm/damon/admins/), and DAMON_RECLAIM module parameters.

Patches Sequence
----------------

First patch implements DAMOS filter interface to DAMON kernel API. Second patch makes the physical address space monitoring operations set to support the filters from all supporting DAMOS actions. Third patch adds anonymous pages filter support to DAMON_RECLAIM, and the fourth patch documents the DAMON_RECLAIM's new feature. Fifth to seventh patches implement DAMON sysfs files for support of the filters, and eighth patch connects the file to use DAMOS filters feature. Ninth patch adds simple self test cases for DAMOS filters of the sysfs interface. Finally, following two patches (tenth and eleventh) document the new features and interfaces.

SeongJae Park (11):
mm/damon/core: implement damos filter
mm/damon/paddr: support DAMOS filters
mm/damon/reclaim: add a parameter called skip_anon for avoiding
anonymous pages reclamation
Docs/admin-guide/damon/reclaim: document 'skip_anon' parameter mm/damon/sysfs-schemes: implement filters directory mm/damon/sysfs-schemes: implement filter directory mm/damon/sysfs-schemes: connect filter directory and filters directory mm/damon/sysfs-schemes: implement scheme filters selftests/damon/sysfs: test filters directory Docs/admin-guide/mm/damon/usage: document DAMOS filters of sysfs Docs/ABI/damon: document scheme filters files

 .../ABI/testing/sysfs-kernel-mm-damon         |  29 ++
 .../admin-guide/mm/damon/reclaim.rst          |   9 +
 Documentation/admin-guide/mm/damon/usage.rst  |  48 ++-
 include/linux/damon.h                         |  51 +++
 mm/damon/core.c                               |  39 ++
 mm/damon/paddr.c                              |  71 +++-
 mm/damon/reclaim.c                            |  19 +
 mm/damon/sysfs-schemes.c                      | 370 +++++++++++++++++-
 tools/testing/selftests/damon/sysfs.sh        |  29 ++
 9 files changed, 652 insertions(+), 13 deletions(-)
Signature · 1 line
2.25.1