From: Mattathias Pinchover via B4 Relay <devnull+mattathias.pinchover.uber.com@kernel.org>
To: SJ Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Cc: damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
Mattathias Pinchover <mattathias.pinchover@uber.com>
Subject: [PATCH 2/6] mm/damon/sysfs-schemes: add sz_ops_filter_passed_last file
Date: Mon, 16 Nov 2026 19:10:05 +0000 [thread overview]
Message-ID: <20261116-damon-sz-ops-b4-v1-2-1cffe7227e6d@uber.com> (raw)
In-Reply-To: <20261116-damon-sz-ops-b4-v1-0-1cffe7227e6d@uber.com>
From: Mattathias Pinchover <mattathias.pinchover@uber.com>
Introduce a new DAMON sysfs interface file for exposing the newly added
DAMOS stat, sz_ops_filter_passed_last. The file has the same
name as the stat and is placed under the DAMOS stats directory. Like
other stats files, it is updated when the stats are refreshed via
refresh_ms or the update_schemes_stats command.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Mattathias Pinchover <mattathias.pinchover@uber.com>
---
mm/damon/sysfs-schemes.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
index 230987efac3a..fe33189e8802 100644
--- a/mm/damon/sysfs-schemes.c
+++ b/mm/damon/sysfs-schemes.c
@@ -370,6 +370,7 @@ struct damon_sysfs_stats {
unsigned long nr_applied;
unsigned long sz_applied;
unsigned long sz_ops_filter_passed;
+ unsigned long sz_ops_filter_passed_last;
unsigned long qt_exceeds;
unsigned long nr_snapshots;
unsigned long max_nr_snapshots;
@@ -425,6 +426,15 @@ static ssize_t sz_ops_filter_passed_show(struct kobject *kobj,
return sysfs_emit(buf, "%lu\n", stats->sz_ops_filter_passed);
}
+static ssize_t sz_ops_filter_passed_last_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ struct damon_sysfs_stats *stats = container_of(kobj,
+ struct damon_sysfs_stats, kobj);
+
+ return sysfs_emit(buf, "%lu\n", stats->sz_ops_filter_passed_last);
+}
+
static ssize_t qt_exceeds_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
@@ -485,6 +495,10 @@ static struct kobj_attribute damon_sysfs_stats_sz_applied_attr =
static struct kobj_attribute damon_sysfs_stats_sz_ops_filter_passed_attr =
__ATTR_RO_MODE(sz_ops_filter_passed, 0400);
+static struct kobj_attribute
+damon_sysfs_stats_sz_ops_filter_passed_last_attr =
+ __ATTR_RO_MODE(sz_ops_filter_passed_last, 0400);
+
static struct kobj_attribute damon_sysfs_stats_qt_exceeds_attr =
__ATTR_RO_MODE(qt_exceeds, 0400);
@@ -500,6 +514,7 @@ static struct attribute *damon_sysfs_stats_attrs[] = {
&damon_sysfs_stats_nr_applied_attr.attr,
&damon_sysfs_stats_sz_applied_attr.attr,
&damon_sysfs_stats_sz_ops_filter_passed_attr.attr,
+ &damon_sysfs_stats_sz_ops_filter_passed_last_attr.attr,
&damon_sysfs_stats_qt_exceeds_attr.attr,
&damon_sysfs_stats_nr_snapshots_attr.attr,
&damon_sysfs_stats_max_nr_snapshots_attr.attr,
@@ -3130,6 +3145,8 @@ void damon_sysfs_schemes_update_stats(
sysfs_stats->sz_applied = scheme->stat.sz_applied;
sysfs_stats->sz_ops_filter_passed =
scheme->stat.sz_ops_filter_passed;
+ sysfs_stats->sz_ops_filter_passed_last =
+ scheme->stat.sz_ops_filter_passed_last;
sysfs_stats->qt_exceeds = scheme->stat.qt_exceeds;
sysfs_stats->nr_snapshots = scheme->stat.nr_snapshots;
}
--
2.54.0-uber3
next prev parent reply other threads:[~2026-11-16 19:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 19:10 [PATCH 0/6] mm/damon: add sz_ops_filter_passed_last DAMOS stat Mattathias Pinchover via B4 Relay
2026-11-16 19:10 ` [PATCH 1/6] mm/damon/core: introduce sz_ops_filter_passed_last stat Mattathias Pinchover via B4 Relay
2026-11-17 2:03 ` SJ Park
2026-11-16 19:10 ` Mattathias Pinchover via B4 Relay [this message]
2026-11-17 2:10 ` [PATCH 2/6] mm/damon/sysfs-schemes: add sz_ops_filter_passed_last file SJ Park
2026-11-16 19:10 ` [PATCH 3/6] mm/damon/tests/core-kunit: test sz_ops_filter_passed_last Mattathias Pinchover via B4 Relay
2026-11-17 2:22 ` SJ Park
2026-11-16 19:10 ` [PATCH 4/6] Docs/mm/damon/design: update for sz_ops_filter_passed_last Mattathias Pinchover via B4 Relay
2026-11-17 2:25 ` SJ Park
2026-11-16 19:10 ` [PATCH 5/6] Docs/admin-guide/mm/damon/usage: " Mattathias Pinchover via B4 Relay
2026-11-17 2:29 ` SJ Park
2026-11-16 19:10 ` [PATCH 6/6] Docs/ABI/damon: " Mattathias Pinchover via B4 Relay
2026-11-17 2:31 ` 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=20261116-damon-sz-ops-b4-v1-2-1cffe7227e6d@uber.com \
--to=devnull+mattathias.pinchover.uber.com@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=mattathias.pinchover@uber.com \
--cc=rdunlap@infradead.org \
--cc=sj@kernel.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
all inboxes | Powered by JetHome®