From: SeongJae Park <sj@kernel.org>
To: pyyjason@gmail.com
Cc: SeongJae Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Usama Arif <usamaarif642@gmail.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v3 1/2] mm/damon: Move has filter to ops-common
Date: Fri, 1 Aug 2025 16:30:44 -0700 [thread overview]
Message-ID: <20250801233044.1392-1-sj@kernel.org> (raw)
In-Reply-To: <a290e7913a1c39f605b8cceafd86d41c2dbebf82.1754088635.git.pyyjason@gmail.com>
On Fri, 1 Aug 2025 22:59:50 +0000 pyyjason@gmail.com wrote:
> From: Yueyang Pan <pyyjason@gmail.com>
>
> This patch moves damon_pa_scheme_has_filter to ops-common. renaming
> to damon_ops_has_filter.
> Doing so allows us to reuse its logic in the vaddr version
> of DAMOS_STAT
Let's update the subject to better reflect the change, e.g.,
mm/damon/paddr: move filters existence check function to ops-common
>
> Signed-off-by: Yueyang Pan <pyyjason@gmail.com>
> ---
> mm/damon/ops-common.c | 9 +++++++++
> mm/damon/ops-common.h | 2 ++
> mm/damon/paddr.c | 11 +----------
> 3 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
> index 99321ff5cb92..de5404477242 100644
> --- a/mm/damon/ops-common.c
> +++ b/mm/damon/ops-common.c
> @@ -412,3 +412,12 @@ unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid)
>
> return nr_migrated;
> }
> +
> +bool damon_ops_has_filter(struct damos *s)
Thank you for renaming this following my suggestion! My suggestion was
damos_ops_has_filter(), though?
> +{
> + struct damos_filter *f;
> +
> + damos_for_each_ops_filter(f, s)
> + return true;
> + return false;
> +}
> diff --git a/mm/damon/ops-common.h b/mm/damon/ops-common.h
> index 61ad54aaf256..d3d36bca90b9 100644
> --- a/mm/damon/ops-common.h
> +++ b/mm/damon/ops-common.h
> @@ -21,3 +21,5 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
>
> bool damos_folio_filter_match(struct damos_filter *filter, struct folio *folio);
> unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid);
> +
> +bool damon_ops_has_filter(struct damos *s);
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index 53a55c5114fb..9d9cdcc10b8e 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -262,22 +262,13 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s,
> return applied * PAGE_SIZE;
> }
>
> -static bool damon_pa_scheme_has_filter(struct damos *s)
> -{
> - struct damos_filter *f;
> -
> - damos_for_each_ops_filter(f, s)
> - return true;
> - return false;
> -}
> -
> static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s,
> unsigned long *sz_filter_passed)
> {
> unsigned long addr;
> struct folio *folio;
>
> - if (!damon_pa_scheme_has_filter(s))
> + if (!damon_ops_has_filter(s))
> return 0;
>
> addr = r->ar.start;
> --
> 2.43.0
Looks good otherwise.
Thanks,
SJ
next prev parent reply other threads:[~2025-08-01 23:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 22:59 [PATCH v3 0/2] mm/damon: Add damos_stat support for vaddr pyyjason
2025-08-01 22:59 ` [PATCH v3 1/2] mm/damon: Move has filter to ops-common pyyjason
2025-08-01 23:30 ` SeongJae Park [this message]
2025-08-01 22:59 ` [PATCH v3 2/2] mm/damon: Add damos_stat support for vaddr pyyjason
2025-08-01 23:39 ` SeongJae Park
2025-08-01 23:39 ` [PATCH v3 0/2] " SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250801233044.1392-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pyyjason@gmail.com \
--cc=usamaarif642@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).