mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
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>
This commit is contained in:
parent
a8ba965a4c
commit
b9bc678bfb
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user