summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSJ Park <sj@kernel.org>2026-07-10 06:46:42 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-08-04 19:18:51 -0700
commitb9bc678bfb6bfdad9b2dcdc4bce33018f81c33ac (patch)
treee4f18cdc496ab09b50e1e619a363a5a1f9b19aac
parenta8ba965a4cbb9863ed399c2095eb0ab601f2dd05 (diff)
mm/damon/core: s/max_nr_accesses/max_merge_score/ in kdamond_fn()
When probe weights are set, DAMON merge logic works with the probe hits weighted sum. The core logic is setting the merge threshold based on the access frequency, though. Before using probe hits based threshold, rename the variables to look more general. Link: https://lore.kernel.org/20260710134651.18084-14-sj@kernel.org Signed-off-by: SJ Park <sj@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--mm/damon/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c
index dd0612e1a408..f7782c69037d 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -3730,7 +3730,6 @@ static void kdamond_init_ctx(struct damon_ctx *ctx)
static int kdamond_fn(void *data)
{
struct damon_ctx *ctx = data;
- unsigned int max_nr_accesses = 0;
unsigned long sz_limit = 0;
pr_debug("kdamond (%d) starts\n", current->pid);
@@ -3764,6 +3763,7 @@ static int kdamond_fn(void *data)
unsigned long next_ops_update_sis = ctx->next_ops_update_sis;
unsigned long sample_interval = ctx->attrs.sample_interval;
bool access_check_disabled = damon_has_probe_weights(ctx);
+ unsigned int max_merge_score = 0;
if (kdamond_wait_activation(ctx))
break;
@@ -3775,7 +3775,7 @@ static int kdamond_fn(void *data)
ctx->passed_sample_intervals++;
if (!access_check_disabled && ctx->ops.check_accesses)
- max_nr_accesses = ctx->ops.check_accesses(ctx);
+ max_merge_score = ctx->ops.check_accesses(ctx);
if (ctx->ops.apply_probes)
ctx->ops.apply_probes(ctx, access_check_disabled,
false);
@@ -3783,7 +3783,7 @@ static int kdamond_fn(void *data)
if (time_after_eq(ctx->passed_sample_intervals,
next_aggregation_sis)) {
kdamond_merge_regions(ctx,
- max_nr_accesses / 10,
+ max_merge_score / 10,
sz_limit);
/* online updates might be made */
sz_limit = damon_apply_min_nr_regions(ctx);