From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH 3/8] mm/damon/ops-common: support hugepage_size damon filter matching
Date: Tue, 15 Sep 2026 07:33:52 -0700 [thread overview]
Message-ID: <20260915143359.91472-4-sj@kernel.org> (raw)
In-Reply-To: <20260915143359.91472-1-sj@kernel.org>
Update ops-common data attribute filter matching logic to support
hugepage_size filter type.
Signed-off-by: SJ Park <sj@kernel.org>
---
mm/damon/ops-common.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index c36cc39cd2c70..77366f42b3e5b 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -536,6 +536,7 @@ bool damon_ops_filter_match(struct damon_filter *filter, struct folio *folio)
{
bool matched = false;
struct mem_cgroup *memcg;
+ size_t folio_sz;
switch (filter->type) {
case DAMON_FILTER_TYPE_ANON:
@@ -558,6 +559,15 @@ bool damon_ops_filter_match(struct damon_filter *filter, struct folio *folio)
matched = filter->memcg_id == mem_cgroup_id(memcg);
rcu_read_unlock();
break;
+ case DAMON_FILTER_TYPE_HUGEPAGE_SIZE:
+ if (!folio) {
+ matched = false;
+ break;
+ }
+ folio_sz = folio_size(folio);
+ matched = filter->range_min <= folio_sz &&
+ folio_sz <= filter->range_max;
+ break;
default:
break;
}
--
2.47.3
next prev parent reply other threads:[~2026-09-15 14:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 14:33 [PATCH 0/8] mm/damon: introduce hugepage_size probe filter SJ Park
2026-09-15 14:33 ` [PATCH 1/8] mm/damon/api: introduce DAMON_FILTER_TYPE_HUGEPAGE_SIZE SJ Park
2026-09-15 14:43 ` sashiko-bot
2026-09-15 14:33 ` [PATCH 2/8] mm/damon/core: commit hugepage_size type damon filter SJ Park
2026-09-15 14:44 ` sashiko-bot
2026-09-15 14:33 ` SJ Park [this message]
2026-09-15 14:47 ` [PATCH 3/8] mm/damon/ops-common: support hugepage_size damon filter matching sashiko-bot
2026-09-15 14:33 ` [PATCH 4/8] mm/damon/sysfs: add min,max files under probe filter directory SJ Park
2026-09-15 14:42 ` sashiko-bot
2026-09-15 14:33 ` [PATCH 5/8] mm/damon/sysfs: support hugepage_size probe filter SJ Park
2026-09-15 14:44 ` sashiko-bot
2026-09-15 14:33 ` [PATCH 6/8] Docs/mm/damon/design: update for " SJ Park
2026-09-15 14:36 ` sashiko-bot
2026-09-15 14:33 ` [PATCH 7/8] Docs/admin-guide/mm/damon/usage: update for hugepage_size SJ Park
2026-09-15 14:39 ` sashiko-bot
2026-09-15 14:53 ` SJ Park
2026-09-15 15:01 ` SJ Park
2026-09-15 14:33 ` [PATCH 8/8] Docs/ABI/damon: update for hugepage_size probe filter SJ Park
2026-09-15 14:41 ` sashiko-bot
2026-09-15 14:58 ` [PATCH 0/8] mm/damon: introduce " SJ Park
2026-09-15 23:39 ` Andrew Morton
2026-09-15 23:49 ` SJ Park
2026-09-16 5:57 ` 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=20260915143359.91472-4-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.