From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Randy Dunlap <rdunlap@infradead.org>,
Shuah Khan <skhan@linuxfoundation.org>,
damon@lists.linux.dev, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 0/4] mm/damon: add lru-active probe filter type
Date: Thu, 12 Nov 2026 21:17:06 -0800 [thread overview]
Message-ID: <20261113051711.89274-1-sj@kernel.org> (raw)
The LRU-activeness of folios is useful information for understanding and
optimizing the system. DAMOS ops filter therefore supports filtering
memory based on the information. Using it, the information can be
extracted in the folio granularity. It is precise but expensive. DAMON
probe filter is the complementary way for getting the information in
region granularity with much cheaper cost. DAMON filter does not
support LRU-activeness based filtering, though. Add the support.
Define new DAMON filter type, DAMON_FILTER_TYPE_ACTIVE, on core API
(patch 1). Add support for it on both vaddr and paddr operation set
(patch 2). Extend DAMON filter sysfs ABI to let users configure DAMON
filters of the type using a new keyword, "active" (patch 3). Finally,
update the DAMON design document to explain the new type (patch 4).
Test
====
Confirmed the functionality like below.
First, start masim [1] to generate a ~476 MiB hot memory region.
$ ./masim.py run --config_file ./configs/stairs-500mb.cfg --repeat 10
Second, start DAMON to monitor data access and active memory ratio of
each region using DAMON user-space tool (damo) [2].
$ sudo ./damo start --target_pid $(pidof masim) \
--probe --probe_prep set_pgidle \
--probe_filter allow pgidle_unset \
--probe --probe_filter allow active \
--probe_weight 1 0
Show the monitoring results.
$ sudo ./damo report attrs
heatmap: 00008[...]82222222222222222222222222222222222222222222222257777789999998888888874444445[...]8
# min/max temperatures: -1,580,000,000, 100,002,000, column size: 62.841 MiB
probes
- prep: set_pgidle, filter: allow pgidle_unset (weight: 1)
- allow active (weight: 0)
intervals: sample 5 ms aggr 100 ms (max probe hits 20)
# size address age probe_hits
0 253.047 MiB 85.984 TiB 15.800 s 0 0
1 4.000 KiB 127.984 TiB 15.400 s 0 20
2 120.000 KiB 127.984 TiB 15.300 s 0 0
3 1.450 GiB 127.407 TiB 11.300 s 0 0
4 498.738 MiB 127.409 TiB 11.200 s 0 0
5 500.273 MiB 127.409 TiB 11.100 s 0 0
6 502.055 MiB 127.409 TiB 10.900 s 0 0
7 461.926 MiB 127.411 TiB 6.500 s 0 0
8 351.754 MiB 127.410 TiB 1.600 s 0 0
9 497.930 MiB 127.411 TiB 0 ns 1 0
10 8.000 KiB 127.984 TiB 0 ns 6 0
11 476.340 MiB 127.410 TiB 1 s 20 0
memory bw estimate: 0 B per second
total size: 4.909 GiB
record DAMON intervals: sample 5 ms, aggr 100 ms
The second (idx 1) 4 KiB memory region is not accessed for 15 seconds
and the page for the region is on an active LRU list. The last 476.340
MiB memory region is accessed for each sample for the last one second as
expected. And nearly all pages of the region are not on an active LRU
list.
[1] https://github.com/sjp38/masim
[2] https://github.com/damonitor/damo
Changes from RFC
- RFC: https://lore.kernel.org/20261108191615.113362-1-sj@kernel.org
- Add test results on the cover letter.
- Rebase to the latest mm-new.
- Drop RFC tag.
The test section and the changelog can be removed from the final commit
message.
SJ Park (4):
mm/damon/api: define DAMON_FILTER_TYPE_ACTIVE
mm/damon/ops-common: implement DAMON_FILTER_TYPE_ACTIVE operation
mm/damon/sysfs: support LRU-activeness based DAMON filter setup
Docs/mm/damon/design: update for DAMON_FILTER_TYPE_ACTIVE
Documentation/mm/damon/design.rst | 1 +
include/linux/damon.h | 2 ++
mm/damon/ops-common.c | 7 +++++++
mm/damon/sysfs.c | 4 ++++
4 files changed, 14 insertions(+)
base-commit: e055da336413b651d1e23d438bb5430f9350d3f8
--
2.47.3
next reply other threads:[~2026-11-13 5:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 5:17 SJ Park [this message]
2026-11-13 5:17 ` [PATCH 4/4] Docs/mm/damon/design: update for DAMON_FILTER_TYPE_ACTIVE SJ Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113051711.89274-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=damon@lists.linux.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox