Re: [RFC PATCH v2.1 01/17] mm/damon/core: introduce DAMON_FILTER_TYPE_PGIDLE_UNSET

SJ Park <[email protected]> Mon, 27 Jul 2026 07:58:41 -0700
Newsgroups dev.linux.lists.damon
Message-ID <[email protected]>
On Mon, 27 Jul 2026 14:47:13 +0000 [email protected] wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The patch introduces `DAMON_FILTER_TYPE_PGIDLE_UNSET` but fails to implement its matching logic or expose it via sysfs.
> --
> 
> --- Patch [1]: [RFC PATCH v2.1 01/17] mm/damon/core: introduce DAMON_FILTER_TYPE_PGIDLE_UNSET ---
> commit 713d89253715d0f67d20248547ddafe132444f89
> Author: SJ Park <[email protected]>
> 
> mm/damon/core: introduce DAMON_FILTER_TYPE_PGIDLE_UNSET
> 
> This commit introduces a new DAMON filter type, pgidle_unset. It is intended
> to match pages that have their PG_Idle flag unset or the page table accessed
> bit set.
> 
> > diff --git a/include/linux/damon.h b/include/linux/damon.h
> > index 0c8b7ddef9abb..a8bb9ee6979e3 100644
> > --- a/include/linux/damon.h
> > +++ b/include/linux/damon.h
> > @@ -742,12 +742,14 @@ struct damon_intervals_goal {
> >  /**
> >   * enum damon_filter_type - Type of &struct damon_filter
> >   *
> > - * @DAMON_FILTER_TYPE_ANON:		Anonymous pages.
> > - * @DAMON_FILTER_TYPE_MEMCG:		Specific memcg's pages.
> > + * @DAMON_FILTER_TYPE_ANON:		Anonymous pages.
> > + * @DAMON_FILTER_TYPE_MEMCG:		Specific memcg's pages.
> > + * @DAMON_FILTER_TYPE_PGIDLE_UNSET:	Pgidle is unset.
> >   */
> >  enum damon_filter_type {
> >  	DAMON_FILTER_TYPE_ANON,
> >  	DAMON_FILTER_TYPE_MEMCG,
> > +	DAMON_FILTER_TYPE_PGIDLE_UNSET,
> 
> [Severity: Medium]
> Are the corresponding implementation details for this new filter type missing
> from this patch?
> 
> The commit message states this will match pages that have their PG_Idle flag
> unset, but the new DAMON_FILTER_TYPE_PGIDLE_UNSET variant doesn't appear to
> be handled in the switch block evaluating filter types within
> damon_pa_filter_match() in mm/damon/paddr.c.
> 
> Additionally, should this be exposed to userspace? The new filter type is
> not mapped in damon_sysfs_filter_type_names in mm/damon/sysfs.c, which would
> prevent it from being configured via sysfs.

Later patches of this series do those.

> 
> >  };
> >  
> >  /**
> 
> -- 
> Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1


Thanks,
SJ