[PATCH v2 0/7] mm/damon: introduce probe_hits_wsum DAMOS core filter

SJ Park posted 7 patches 1 week, 6 days ago
Documentation/admin-guide/mm/damon/usage.rst |  4 +++
Documentation/mm/damon/design.rst            |  3 ++
include/linux/damon.h                        | 22 ++++++++++-----
mm/damon/core.c                              | 20 ++++++++++++--
mm/damon/paddr.c                             |  2 +-
mm/damon/sysfs-schemes.c                     | 29 ++++++++++++++------
mm/damon/vaddr.c                             |  2 +-
7 files changed, 62 insertions(+), 20 deletions(-)
[PATCH v2 0/7] mm/damon: introduce probe_hits_wsum DAMOS core filter
Posted by SJ Park 1 week, 6 days ago
DAMON can do flexible data attributes monitoring.  The classical data
access monitoring can also be done using the attributes monitoring.  The
access event is just one of the data attributes that DAMON supports.
Users do monitoring to make some actions based on it.  DAMOS is a
feature for automating that.  However, DAMOS cannot utilize the data
attributes monitoring results.  It is still Data "Access"
Monitoring-based Operation Schemes.  It requires users to set the target
"access" pattern.

DAMOS core filter is effectively the same as the target access pattern.
It is just a more generalized and flexible way of describing the
operation action target region.  Introduce a new DAMOS core filter type,
probe_hits_wsum.  It specifies the filter target based on a range of the
probe hits weighted sum.  Using this, users can apply DAMOS actions to
regions of specific data attributes pattern.

Note that the classic target access pattern still works.  Hence the
target nr_accesses range should still be properly configured.  The new
filter would be used in only data attributes-only mode.  In the mode,
classic access monitoring is just turned off, and therefore nr_accesses
of regions are always zero.  Users could simply set the target
nr_accesses range to include the zero nr_Accesses regions.

Patches Sequence
================

Patch 1 updates the DAMON kernel API for the new filter type.  Patch 2
extends damon_probe_hits_wsum() to do the calculation based on moving
sum.  Patch 3 implements the filter type in the core layer.  Patch 4
refactors DAMON sysfs interface internal data structure for efficient
reuse of data structure for the probe hits weighted sum range user
inputs.  Patch 5 updates DAMON sysfs interface to support the new filter
type.  Patches 6 and 7 update design and usage documents for the new
filter type, respectively.

Changelog
=========

Changes from RFC v2.2
- RFC v2.2: https://lore.kernel.org/20260911011330.93678-1-sj@kernel.org
- Drop RFC tag again.
- Rebase to latest mm-new.
Changes from v1
- v1: https://lore.kernel.org/20260910141849.170896-1-sj@kernel.org
- Validate {min,max}_range sysfs input on local variables.
- Add RFC tag again.
Changes from RFC v2.1
- RFC v2.1: https://lore.kernel.org/20260910040319.147037-1-sj@kernel.org
- Update kernel-doc to clarify probe_hits_wsum is a damos core filter.
- Drop RFC tag.
Changes from RFC v2
- RFC v2: https://lore.kernel.org/20260907171218.101430-1-sj@kernel.org
- Rebase to latest mm-new.
Changes from RFC
- RFC: https://lore.kernel.org/20260906210513.106895-1-sj@kernel.org
- Fix kernel-doc typo.
- Use moving sum based weighted sum.
- Fix wrong range saving field names in sysfs.

SJ Park (7):
  mm/damon/api: introduce DAMOS_FILTER_TYPE_PROBE_HITS_WSUM
  mm/damon/core: extend probe_hits_wsum() for moving sum based
    calculation
  mm/damon/core: support probe_hits_wsum damos core filter
  mm/damon/sysfs-schemes: rename sysfs_filter->sz_range to
    range_{min,max}
  mm/damon/sysfs-schemes: support probe_hits_wsum damos core filter
  Docs/mm/damon/design: update for probe_hits_wsum DAMOS core filter
  Docs/admin-guide/mm/damon/usage: update for probe_hits_wsum DAMOS
    filter

 Documentation/admin-guide/mm/damon/usage.rst |  4 +++
 Documentation/mm/damon/design.rst            |  3 ++
 include/linux/damon.h                        | 22 ++++++++++-----
 mm/damon/core.c                              | 20 ++++++++++++--
 mm/damon/paddr.c                             |  2 +-
 mm/damon/sysfs-schemes.c                     | 29 ++++++++++++++------
 mm/damon/vaddr.c                             |  2 +-
 7 files changed, 62 insertions(+), 20 deletions(-)


base-commit: e81bad1a9d225410ad05860d729169baadb2543a
-- 
2.47.3
Re: [PATCH v2 0/7] mm/damon: introduce probe_hits_wsum DAMOS core filter
Posted by Andrew Morton 1 week, 6 days ago
On Fri, 11 Sep 2026 06:55:02 -0700 SJ Park <sj@kernel.org> wrote:

> DAMON can do flexible data attributes monitoring.  The classical data
> access monitoring can also be done using the attributes monitoring.  The
> access event is just one of the data attributes that DAMON supports.
> Users do monitoring to make some actions based on it.  DAMOS is a
> feature for automating that.  However, DAMOS cannot utilize the data
> attributes monitoring results.  It is still Data "Access"
> Monitoring-based Operation Schemes.  It requires users to set the target
> "access" pattern.
> 
> DAMOS core filter is effectively the same as the target access pattern.
> It is just a more generalized and flexible way of describing the
> operation action target region.  Introduce a new DAMOS core filter type,
> probe_hits_wsum.  It specifies the filter target based on a range of the
> probe hits weighted sum.  Using this, users can apply DAMOS actions to
> regions of specific data attributes pattern.
> 
> Note that the classic target access pattern still works.  Hence the
> target nr_accesses range should still be properly configured.  The new
> filter would be used in only data attributes-only mode.  In the mode,
> classic access monitoring is just turned off, and therefore nr_accesses
> of regions are always zero.  Users could simply set the target
> nr_accesses range to include the zero nr_Accesses regions.

Thanks, added.  Along with your -fix for [1/7].
Re: [PATCH v2 0/7] mm/damon: introduce probe_hits_wsum DAMOS core filter
Posted by SJ Park 1 week, 6 days ago
On Fri, 11 Sep 2026 06:55:02 -0700 SJ Park <sj@kernel.org> wrote:

> DAMON can do flexible data attributes monitoring.  The classical data
> access monitoring can also be done using the attributes monitoring.  The
> access event is just one of the data attributes that DAMON supports.
> Users do monitoring to make some actions based on it.  DAMOS is a
> feature for automating that.  However, DAMOS cannot utilize the data
> attributes monitoring results.  It is still Data "Access"
> Monitoring-based Operation Schemes.  It requires users to set the target
> "access" pattern.
> 
> DAMOS core filter is effectively the same as the target access pattern.
> It is just a more generalized and flexible way of describing the
> operation action target region.  Introduce a new DAMOS core filter type,
> probe_hits_wsum.  It specifies the filter target based on a range of the
> probe hits weighted sum.  Using this, users can apply DAMOS actions to
> regions of specific data attributes pattern.

Sashiko found no blocker for this series but a minor documentation issue that
better to be clearified.  Because it is too trivial for reposting entire series
in my opinion, I asked Andrew to pick a fixup [1] for that together.

Sashiko send its findings to damon@ mailing list [2], and I reply those if
anything needs to be clarified.  Please refer to those for details.

[1] https://lore.kernel.org/20260911142522.98013-1-sj@kernel.org
[2] https://lore.kernel.org/damon/


Thanks,
SJ

[...]