From: Gutierrez Asier <gutierrez.asier@huawei-partners.com>
To: SeongJae Park <sj@kernel.org>
Cc: <artem.kuzin@huawei.com>, <stepanov.anatoly@huawei.com>,
<wangkefeng.wang@huawei.com>, <yanquanmin1@huawei.com>,
<zuoze1@huawei.com>, <damon@lists.linux.dev>,
<akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] mm/damon: remove unused code
Date: Fri, 13 Feb 2026 12:22:23 +0300 [thread overview]
Message-ID: <eebad564-10c1-4ce9-953d-c859cd87dc88@huawei-partners.com> (raw)
In-Reply-To: <20260212154157.75372-1-sj@kernel.org>
Hi,
On 2/12/2026 6:41 PM, SeongJae Park wrote:
> On Thu, 12 Feb 2026 09:43:26 +0000 <gutierrez.asier@huawei-partners.com> wrote:
>
>> From: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
>>
>> damon_target is not used by get_scheme_score operations, nor with
>> virtual neither with physical addresses.
>
> Good finding, thank you for this patch, Asier!
>
> The subject seems bit ambiguous, though. What about "remove unused target
> param of get_scheme_score()" ?
>
>>
>> Signed-off-by: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
>
> Other than the subject,
>
> Reviewed-by: SeongJae Park <sj@kernel.org>
>
> Also, DAMON patches are recommended to use mm-new as thier baseline [1] unless
> there are other reasons to not to do so. But I found 'git am' of this patch on
> the mm-new fails. It works on the master of mm.git, which is a commit of
> Linus' tree, though. So, maybe this patch is not using mm-new as the baseline?
> Please consider using mm-new as the baseline next time, or specify why you use
> choose different tree as the baseline.
>
> Assuming you are ok to the subject change (let me know if you are not), I'm
> attaching a new version of this patch that has changed the subject with my
> suggestion, and manually resolved the conflicts on mm-new, for Andrew's
> convenience. I also applied that to my tree (damon/next), and I will repost it
> if Andrew miss this (as we are in the middle of merge window, maintainers could
> miss many things).
>
> [1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
>
>
> Thanks,
> SJ
>
> [...]
> ======= >8 =======
> From e09d66bb116604c9dc5b22540641e991d977ea6b Mon Sep 17 00:00:00 2001
> From: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
> Date: Thu, 12 Feb 2026 09:43:26 +0000
> Subject: [PATCH] mm/damon/: remove unused target param of get_scheme_score()
>
> damon_target is not used by get_scheme_score operations, nor with
> virtual neither with physical addresses.
>
> Signed-off-by: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
>
> Link: https://patch.msgid.link/20260212094326.906497-1-gutierrez.asier@huawei-partners.com
> Signed-off-by: SeongJae Park <sj@kernel.org>
> ---
> include/linux/damon.h | 3 +--
> mm/damon/core.c | 10 +++++-----
> mm/damon/paddr.c | 3 +--
> mm/damon/vaddr.c | 3 +--
> 4 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/damon.h b/include/linux/damon.h
> index a4fea23da8576..9a88cf8d152d8 100644
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -647,8 +647,7 @@ struct damon_operations {
> void (*prepare_access_checks)(struct damon_ctx *context);
> unsigned int (*check_accesses)(struct damon_ctx *context);
> int (*get_scheme_score)(struct damon_ctx *context,
> - struct damon_target *t, struct damon_region *r,
> - struct damos *scheme);
> + struct damon_region *r, struct damos *scheme);
> unsigned long (*apply_scheme)(struct damon_ctx *context,
> struct damon_target *t, struct damon_region *r,
> struct damos *scheme, unsigned long *sz_filter_passed);
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 5e2724a4f285e..925908415a041 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1679,15 +1679,15 @@ static bool __damos_valid_target(struct damon_region *r, struct damos *s)
> r->age <= s->pattern.max_age_region;
> }
>
> -static bool damos_valid_target(struct damon_ctx *c, struct damon_target *t,
> - struct damon_region *r, struct damos *s)
> +static bool damos_valid_target(struct damon_ctx *c, struct damon_region *r,
> + struct damos *s)
> {
> bool ret = __damos_valid_target(r, s);
>
> if (!ret || !s->quota.esz || !c->ops.get_scheme_score)
> return ret;
>
> - return c->ops.get_scheme_score(c, t, r, s) >= s->quota.min_score;
> + return c->ops.get_scheme_score(c, r, s) >= s->quota.min_score;
> }
>
> /*
> @@ -2011,7 +2011,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
> s->max_nr_snapshots <= s->stat.nr_snapshots)
> continue;
>
> - if (damos_valid_target(c, t, r, s))
> + if (damos_valid_target(c, r, s))
> damos_apply_scheme(c, t, r, s);
>
> if (damon_is_last_region(r, t))
> @@ -2309,7 +2309,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
> damon_for_each_region(r, t) {
> if (!__damos_valid_target(r, s))
> continue;
> - score = c->ops.get_scheme_score(c, t, r, s);
> + score = c->ops.get_scheme_score(c, r, s);
> c->regions_score_histogram[score] +=
> damon_sz_region(r);
> if (score > max_score)
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index 9bfe488268407..5cdcc5037cbc1 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -343,8 +343,7 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
> }
>
> static int damon_pa_scheme_score(struct damon_ctx *context,
> - struct damon_target *t, struct damon_region *r,
> - struct damos *scheme)
> + struct damon_region *r, struct damos *scheme)
> {
> switch (scheme->action) {
> case DAMOS_PAGEOUT:
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index 83ab3d8c37920..4e3430d4191d1 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -986,8 +986,7 @@ static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx,
> }
>
> static int damon_va_scheme_score(struct damon_ctx *context,
> - struct damon_target *t, struct damon_region *r,
> - struct damos *scheme)
> + struct damon_region *r, struct damos *scheme)
> {
>
> switch (scheme->action) {
Yes, I will change the subject.
My bad, I didn't try the patch against mm-next. Indeed, as you
suggested, it doesn't compile. I will submit a new version
of this patch after checking it works with mm-next.
--
Asier Gutierrez
Huawei
prev parent reply other threads:[~2026-02-13 9:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 9:43 gutierrez.asier
2026-02-12 15:41 ` SeongJae Park
2026-02-12 16:51 ` SeongJae Park
2026-02-13 9:22 ` Gutierrez Asier [this message]
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=eebad564-10c1-4ce9-953d-c859cd87dc88@huawei-partners.com \
--to=gutierrez.asier@huawei-partners.com \
--cc=akpm@linux-foundation.org \
--cc=artem.kuzin@huawei.com \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
--cc=stepanov.anatoly@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=yanquanmin1@huawei.com \
--cc=zuoze1@huawei.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