Skip to content

mm/damon: introduce age_ms damos core filter type

SJ Park damon linux-doc linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Changes from RFC v2 from the cover letter

- RFC v2: https://lore.kernel.org/[email protected]
- Rebase to the latet mm-new.
- Collect R-b: from Aveline.
- Add test results to the cover letter.
Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Use div_u64() to avoid 32 bit overflow of age_ms in core.
- Rebase to the latest mm-new.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm/damon/core: add DAMOS_FILTER_TYPE_AGE_MSinclude/linux/damon.h mm/damon/core.c+19 -70 replies
2/4mm/damon/sysfs-schemes: support DAMOS_FILTER_TYPE_AGE_MSmm/damon/sysfs-schemes.c+5 -00 replies
3/4Docs/mm/damon/design: update for age_ms damos core filter typeDocumentation/mm/damon/design.rst+3 -00 replies
4/4Docs/admin-guide/mm/damon/usage: update for age_ms damos core filterDocumentation/admin-guide/mm/damon/usage.rst+3 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAveline Noir
1/4R-b
2/4R-b
3/4R-b
4/4R-b

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

Read the v1 thread

Cover letter [PATCH 0/4] mm/damon: introduce age_ms damos core filter type

DAMOS access pattern supports selecting regions to apply a given operation to, based on their age (access frequency stability). The age is specified in the aggregation intervals unit. The aggregation interval can be changed by users or intervals auto-tuning features. If the intention is to specify the age in a deterministic way (e.g., 2 minutes), it should be updated for each aggregation interval update. Doing so is cumbersome and challenging, particularly in the interval auto-tuning case.

One straightforward solution is extending the DAMOS access pattern for specific deterministic time based age specification. However, DAMOS core filter is a better option. It is playing a similar role in a more flexible way. It can be used for both accepting and rejecting regions based on if they matched or unmatched to a given criteria. Multiple filters can also be combined for more flexible and detailed rules.

Extend DAMOS core filter to support milliseconds unit based age criteria.

Implement a new DAMOS core filter type, DAMOS_FILTER_TYPE_AGE_MS, in core layer and expose to DAMON API, via patch 1. Add the support of the feature on DAMON sysfs ABI with patch 2. Update the design and usage documents to explain the new features with patches 3 and 4, respectively.

Reviewer notes (no need to be in git history).

Test
====

Confirmed the age_ms filter is working using masim [1] and DAMON user-space tool [2]'s DAMOS filter-based snapshot feature, like below.

Start masim.

    $ ./masim.py run --config_file ./configs/stairs-500mb.cfg \
            --quiet --repeat 10 &

Start DAMON for access monitoring.

    $ sudo ./damo start --probe \
            --probe_prep set_pgidle --probe_filter allow pgidle_unset

Monitoring results without an age_ms filter shows regions of any age.

    $ sudo ./damo report attrs --style idle-time-percentiles
    # total recency percentiles
    <percentile> <idle time>
      0     0 ns  |                    |
      1     0 ns  |                    |
     25   100 ms  |                    |
     50  3.300 s  |****************    |
     75      4 s  |******************* |
     99  4.100 s  |********************|
    100  4.100 s  |********************|
    memory bw estimate: 66.628 GiB per second
    total size: 7.797 GiB
    record DAMON intervals: sample 5 ms, aggr 100 ms

With an age_ms DAMOS filter applied for snapshotting, shows regions of given age range.

For [0, 2s range]

    $ sudo ./damo report attrs --style idle-time-percentiles \
            --snapshot_damos_filter allow age_ms 0 2s
    # total recency percentiles
    <percentile> <idle time>
      0     0 ns  |                    |
      1     0 ns  |                    |
     25     0 ns  |                    |
     50     0 ns  |                    |
     75   100 ms  |*                   |
     99   200 ms  |**                  |
    100  1.600 s  |********************|
    memory bw estimate: 100.311 GiB per second  df-passed: 0 B per second
    total size: 7.797 GiB  df-passed 0 B
    scheme stats
    tried 0 times (0 B)
    applied 0 times (0 B)
    0 B passed filters
    quota exceeded 0 times
    0 B
    tried 0 snapshots (max 0)
    record DAMON intervals: sample 5 ms, aggr 100 ms

[1] https://github.com/sjp38/masim
[2] https://github.com/damonitor/damo

Changes from RFC v2
- RFC v2: https://lore.kernel.org/[email protected]
- Rebase to the latet mm-new.
- Collect R-b: from Aveline.
- Add test results to the cover letter.
Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Use div_u64() to avoid 32 bit overflow of age_ms in core.
- Rebase to the latest mm-new.

SJ Park (4):
mm/damon/core: add DAMOS_FILTER_TYPE_AGE_MS mm/damon/sysfs-schemes: support DAMOS_FILTER_TYPE_AGE_MS Docs/mm/damon/design: update for age_ms damos core filter type Docs/admin-guide/mm/damon/usage: update for age_ms damos core filter

 Documentation/admin-guide/mm/damon/usage.rst |  3 +++
 Documentation/mm/damon/design.rst            |  3 +++
 include/linux/damon.h                        | 16 ++++++++++------
 mm/damon/core.c                              | 10 +++++++++-
 mm/damon/sysfs-schemes.c                     |  5 +++++
 5 files changed, 30 insertions(+), 7 deletions(-)

base-commit: f10c161fdac5b0b3fac99877805e64e682c56281

Signature · 1 line
2.47.3