[RFC PATCH v2 1/8] mm/damon/api: introduce DAMON_FILTER_TYPE_HUGEPAGE_SIZE
From: SJ Park
Date: Mon Sep 14 2026 - 11:53:40 EST
Introduce a new data attribute probe filter type, hugepage_size. It
will work for memory that is backed by a hugepage of a given size range.
Add a new damon_filter_type enum DAMON_FILTER_TYPE_HUGEPAGE_SIZE to
identify the type. Add two new fields in the damon_filter struct for
saving the size range.
Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
include/linux/damon.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/damon.h b/include/linux/damon.h
index 4be7d1df8e71f..bbb190b474015 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -783,12 +783,14 @@ struct damon_prep {
* @DAMON_FILTER_TYPE_MEMCG: Specific memcg's pages.
* @DAMON_FILTER_TYPE_PGIDLE_UNSET: Pgidle is unset.
* @DAMON_FILTER_TYPE_PGIDLE_SET: Pgidle is set.
+ * @DAMON_FILTER_TYPE_HUGEPAGE_SIZE: Page is part of a hugepage.
*/
enum damon_filter_type {
DAMON_FILTER_TYPE_ANON,
DAMON_FILTER_TYPE_MEMCG,
DAMON_FILTER_TYPE_PGIDLE_UNSET,
DAMON_FILTER_TYPE_PGIDLE_SET,
+ DAMON_FILTER_TYPE_HUGEPAGE_SIZE,
};
/**
@@ -798,6 +800,8 @@ enum damon_filter_type {
* @matching: Whether this filter is for the type-matching ones.
* @allow: Whether the @type-@matching ones should pass this filter.
* @memcg_id: Memcg id of the question if @type is DAMON_FILTER_MEMCG.
+ * @range_min: Minimum value of range arguments.
+ * @range_max: Maximum value of range arguments.
*/
struct damon_filter {
enum damon_filter_type type;
@@ -805,6 +809,10 @@ struct damon_filter {
bool allow;
union {
u64 memcg_id;
+ struct {
+ unsigned long range_min;
+ unsigned long range_max;
+ };
};
/* private: */
/* Siblings list. */
--
2.47.3