[PATCH 6/6] mm/damon/stat: support aging_flush
From: Krishna Iyer
Date: Sun Aug 30 2026 - 01:16:09 EST
Let DAMON_STAT users opt in to flush-assisted access bit clearing via a
module parameter of the same name as the monitoring context option.
The parameter is applied when the monitoring context is built, i.e., at
enable time. Defaults to off (current behavior).
Intended for virtualization hosts backing guest memory with hugetlb
pages, where non-flushing aging pins the observed access rate to the
TLB-refill rate (see the aging_flush core patch for details). Such
deployments can set damon_stat.aging_flush=1 on the kernel command
line.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Krishna Iyer <kiyer@xxxxxxxxx>
---
mm/damon/stat.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/damon/stat.c b/mm/damon/stat.c
index b05b68f73e10..e093383ba406 100644
--- a/mm/damon/stat.c
+++ b/mm/damon/stat.c
@@ -47,6 +47,11 @@ module_param(aggr_interval_us, ulong, 0400);
MODULE_PARM_DESC(aggr_interval_us,
"Current tuned aggregation interval in microseconds");
+static bool aging_flush __read_mostly;
+module_param(aging_flush, bool, 0600);
+MODULE_PARM_DESC(aging_flush,
+ "Flush TLBs when clearing access bits (applied at enable time)");
+
static struct damon_ctx *damon_stat_context;
static unsigned long damon_stat_last_refresh_jiffies;
@@ -178,6 +183,7 @@ static struct damon_ctx *damon_stat_build_ctx(void)
if (damon_select_ops(ctx, DAMON_OPS_PADDR))
goto free_out;
+ ctx->aging_flush = aging_flush;
target = damon_new_target();
if (!target)
--
2.54.0