Re: [RFC PATCH 08/19] mm/damon/paddr: support data attributes monitoring
From: SeongJae Park
Date: Sat May 09 2026 - 14:11:21 EST
On Sun, 26 Apr 2026 13:52:09 -0700 SeongJae Park <sj@xxxxxxxxxx> wrote:
> Implement and register damon_operations->apply_probes() callback to
> support data attributes monitoring.
>
> Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
> ---
> mm/damon/paddr.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index 5cdcc5037cbc1..cacfbf774ca4f 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -120,6 +120,50 @@ static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
> return max_nr_accesses;
> }
>
> +static bool damon_pa_filter_pass(phys_addr_t pa, struct damon_probe *p)
> +{
> + struct damon_filter *f;
> + bool default_pass = true;
> +
> + damon_for_each_filter(f, p) {
> + bool matched = false;
> +
> + if (f->type == DAMON_TEST_TYPE_ANON) {
> + struct folio *folio = damon_get_folio(PHYS_PFN(pa));
> +
> + if (folio)
> + matched = folio_test_anon(folio);
> + }
This code is leaking the folio. I will add folio_put() in the next revision.
> + if (matched)
> + return f->allow;
> + default_pass = !f->allow;
> + }
> + return default_pass;
> +}
Thanks,
SJ
[...]