mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
mm/damon/paddr: respect return_max_wsum
apply_probes() ops implementation in DAMON_PADDR is ignoring return_max_wsum. Respect it. Link: https://lore.kernel.org/20260710134651.18084-7-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
cfe9e8c738
commit
3858025f48
|
|
@ -172,6 +172,7 @@ static unsigned int damon_pa_apply_probes(struct damon_ctx *ctx,
|
|||
struct damon_target *t;
|
||||
struct damon_region *r;
|
||||
struct damon_probe *p;
|
||||
unsigned int max_wsum = 0;
|
||||
|
||||
damon_for_each_target(t, ctx) {
|
||||
damon_for_each_region(r, t) {
|
||||
|
|
@ -182,7 +183,6 @@ static unsigned int damon_pa_apply_probes(struct damon_ctx *ctx,
|
|||
if (set_samples)
|
||||
r->sampling_addr = damon_rand(ctx, r->ar.start,
|
||||
r->ar.end);
|
||||
|
||||
pa = damon_pa_phys_addr(r->sampling_addr,
|
||||
ctx->addr_unit);
|
||||
folio = damon_get_folio(PHYS_PFN(pa));
|
||||
|
|
@ -193,9 +193,12 @@ static unsigned int damon_pa_apply_probes(struct damon_ctx *ctx,
|
|||
}
|
||||
if (folio)
|
||||
folio_put(folio);
|
||||
if (return_max_wsum)
|
||||
max_wsum = max(damon_probe_hits_wsum(r, false,
|
||||
ctx), max_wsum);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return max_wsum;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user