Skip to content

mm/damon: add sysfs dirs for managing DAMOS filters based on handling layers

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

Status from this message: [merged mm-stable] docs-admin-guide-mm-damon-usage-update-for-coreops_filters-directories.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 0 repliesApplied 8/8

Patches in v1 All 8 applied

#Subject and filesSizeRepliesApplied
1/8mm/damon/sysfs-schemes: let damon_sysfs_scheme_set_filters() be used for different named directoriesmm/damon/sysfs-schemes.c+7 -40 repliesApplied
2/8mm/damon/sysfs-schemes: implement core_filters and ops_filters directoriesmm/damon/sysfs-schemes.c+38 -20 repliesApplied
3/8mm/damon/sysfs-schemes: commit filters in {core,ops}_filters directoriesmm/damon/sysfs-schemes.c+11 -30 repliesApplied
4/8mm/damon/core: expose damos_filter_for_ops() to DAMON kernel API callersinclude/linux/damon.h mm/damon/core.c+9 -10 repliesApplied
5/8mm/damon/sysfs-schemes: record filters of which layer should be added to the given filters directorymm/damon/sysfs-schemes.c+36 -100 repliesApplied
6/8mm/damon/sysfs-schemes: return error when for attempts to install filters on wrong sysfs directorymm/damon/sysfs-schemes.c+20 -00 repliesApplied
7/8Docs/ABI/damon: document {core,ops}_filters directoriesDocumentation/ABI/testing/sysfs-kernel-mm-damon+16 -00 repliesApplied
8/8Docs/admin-guide/mm/damon/usage: update for {core,ops}_filters directoriesDocumentation/admin-guide/mm/damon/usage.rst+22 -90 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/8] mm/damon: add sysfs dirs for managing DAMOS filters based on handling layers

DAMOS filters are categorized into two groups based on their handling layers, namely core and operations layers. The categorization affects when each filter is evaluated. Core layer handled filters are evaluated first. The order meant nothing before, but introduction of allow filters changed that.

DAMOS sysfs interface provides single directory for filters, namely 'filters'. Users can install any filters in any order there. DAMON will internally categorize those into core and operations layer handled ones, and apply the evaluation order rule. The ordering rule is clearly documented. But the interface could still confuse users since it is allowed to install filters on the directory in mixed ways.

Add two sysfs directories for managing filters by handling layers, namely 'core_filters' and 'ops_filters' for filters that handled by core and operations layer, respectively. Those are avoided to be used for installing filters that not handled by the assumed layers.

For backward compatibility, keep 'filters' directory with its curernt behavior. Filters installed in the directory will be added to DAMON after those of 'core_filters' and 'ops_filters' directories, with the automatic categorizations. Also recommend users to use the new directories while noticing 'filters' directory could be deprecated in future on the usage documents.

Note that new directories provide all features that were provided with 'filters', but just in a more clear way. Deprecating 'filters' in future will hence not make an irreversal feature loss.

Changes from RFC
(https://lore.kernel.org/[email protected])
- Fix sphinx error on usage doc change
- Wrodsmith commit messages
- Rebase on latest mm-unstable

SeongJae Park (8):
mm/damon/sysfs-schemes: let damon_sysfs_scheme_set_filters() be used
for different named directories
mm/damon/sysfs-schemes: implement core_filters and ops_filters
directories
mm/damon/sysfs-schemes: commit filters in {core,ops}_filters
directories
mm/damon/core: expose damos_filter_for_ops() to DAMON kernel API
callers
mm/damon/sysfs-schemes: record filters of which layer should be added
to the given filters directory
mm/damon/sysfs-schemes: return error when for attempts to install
filters on wrong sysfs directory
Docs/ABI/damon: document {core,ops}_filters directories Docs/admin-guide/mm/damon/usage: update for {core,ops}_filters
directories

 .../ABI/testing/sysfs-kernel-mm-damon         |  16 +++
 Documentation/admin-guide/mm/damon/usage.rst  |  31 +++--
 include/linux/damon.h                         |   1 +
 mm/damon/core.c                               |   9 +-
 mm/damon/sysfs-schemes.c                      | 119 ++++++++++++++++--
 5 files changed, 153 insertions(+), 23 deletions(-)

base-commit: d5ce0f2fd108557fb138adccb203441d0d70f1c4

Signature · 1 line
2.39.5