summaryrefslogtreecommitdiff
path: root/mm/damon/stat.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2025-11-27 14:17:02 -0800
committerAndrew Morton <akpm@linux-foundation.org>2025-11-27 14:17:02 -0800
commitbc947af67759c2d229e31af9bf232f9ade6145d8 (patch)
treea3f5c1731f5367a60df47cafa194260ed63afaa0 /mm/damon/stat.c
parent58b6fcd2ab34399258dc509f701d0986a8e0bcaa (diff)
parent7c9580f44f90f7a4c11fc7831efe323ebe446091 (diff)
Merge branch 'mm-hotfixes-stable' into mm-nonmm-stable in order to be able
to merge "kho: make debugfs interface optional" into mm-nonmm-stable.
Diffstat (limited to 'mm/damon/stat.c')
-rw-r--r--mm/damon/stat.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/damon/stat.c b/mm/damon/stat.c
index d8010968bbed..bf8626859902 100644
--- a/mm/damon/stat.c
+++ b/mm/damon/stat.c
@@ -46,6 +46,8 @@ MODULE_PARM_DESC(aggr_interval_us,
static struct damon_ctx *damon_stat_context;
+static unsigned long damon_stat_last_refresh_jiffies;
+
static void damon_stat_set_estimated_memory_bandwidth(struct damon_ctx *c)
{
struct damon_target *t;
@@ -130,13 +132,12 @@ static void damon_stat_set_idletime_percentiles(struct damon_ctx *c)
static int damon_stat_damon_call_fn(void *data)
{
struct damon_ctx *c = data;
- static unsigned long last_refresh_jiffies;
/* avoid unnecessarily frequent stat update */
- if (time_before_eq(jiffies, last_refresh_jiffies +
+ if (time_before_eq(jiffies, damon_stat_last_refresh_jiffies +
msecs_to_jiffies(5 * MSEC_PER_SEC)))
return 0;
- last_refresh_jiffies = jiffies;
+ damon_stat_last_refresh_jiffies = jiffies;
aggr_interval_us = c->attrs.aggr_interval;
damon_stat_set_estimated_memory_bandwidth(c);
@@ -210,6 +211,8 @@ static int damon_stat_start(void)
err = damon_start(&damon_stat_context, 1, true);
if (err)
return err;
+
+ damon_stat_last_refresh_jiffies = jiffies;
call_control.data = damon_stat_context;
return damon_call(damon_stat_context, &call_control);
}