From: SeongJae Park <sj@kernel.org>
To: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
akpm@linux-foundation.org, corbet@lwn.net, bijan311@gmail.com,
ajayjoshi@micron.com, honggyu.kim@sk.com, yunjeong.mun@sk.com
Subject: Re: [RFC PATCH v3 1/4] mm/damon/sysfs: set goal_tuner after scheme creation
Date: Mon, 23 Feb 2026 17:40:11 -0800 [thread overview]
Message-ID: <20260224014011.56624-1-sj@kernel.org> (raw)
In-Reply-To: <20260223123232.12851-2-ravis.opensrc@gmail.com>
On Mon, 23 Feb 2026 12:32:29 +0000 Ravi Jonnalagadda <ravis.opensrc@gmail.com> wrote:
> damon_new_scheme() always sets quota.goal_tuner to CONSIST (the default)
> regardless of what was passed in the quota struct. This caused the sysfs
> goal_tuner setting to be ignored.
>
> The comment in damon_new_scheme() says "quota.goals and .goal_tuner
> should be separately set by caller", but the sysfs code wasn't doing
> this. Add explicit assignment of goal_tuner after damon_new_scheme()
> returns to properly apply the user's setting.
>
> Without this fix, setting goal_tuner to "temporal" via sysfs has no
> effect - the scheme always uses the CONSIST (feed loop) tuner, causing
> overshoot when the goal is reached instead of immediate stop.
Thank you for catching this, Ravi! So, this is a fix for the RFC patch series
[1] that not yet merged, right? I think this fix is better to be carried with
the series, and squashed into the broken commit to not introduce unnecessary
regression.
So, if you don't mind, I will squash this into the sysfs-schemes part change on
my tree, with your Co-developed-by: tag.
[1] https://lore.kernel.org/20260212062314.69961-1-sj@kernel.org
[2] https://lore.kernel.org/20260212062314.69961-4-sj@kernel.org
>
> Signed-off-by: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
> ---
> mm/damon/sysfs-schemes.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
> index bbea908074bb..fe2e3b2db9e1 100644
> --- a/mm/damon/sysfs-schemes.c
> +++ b/mm/damon/sysfs-schemes.c
> @@ -2809,6 +2809,9 @@ static struct damos *damon_sysfs_mk_scheme(
> if (!scheme)
> return NULL;
>
> + /* Set goal_tuner after damon_new_scheme() as it defaults to CONSIST */
> + scheme->quota.goal_tuner = sysfs_quotas->goal_tuner;
> +
> err = damos_sysfs_add_quota_score(sysfs_quotas->goals, &scheme->quota);
> if (err) {
> damon_destroy_scheme(scheme);
To follow the order on the comment ("quota.goals and .goal_tuner should be
separately set by caller"), I'd prefer setting the goal_tuner after
damos_sysfs_add_quota_Score() call here, if you don't mind. Let me know if you
prefer keeping the current order. If not, I will just make the change when I
apply this to damon/next.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-02-24 1:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 12:32 [RFC PATCH v3 0/4] mm/damon: Introduce node_eligible_mem_bp and node_ineligible_mem_bp Quota Goal Metrics Ravi Jonnalagadda
2026-02-23 12:32 ` [RFC PATCH v3 1/4] mm/damon/sysfs: set goal_tuner after scheme creation Ravi Jonnalagadda
2026-02-24 1:40 ` SeongJae Park [this message]
2026-02-23 12:32 ` [RFC PATCH v3 2/4] mm/damon: fix esz=0 quota bypass allowing unlimited migration Ravi Jonnalagadda
2026-02-24 1:54 ` SeongJae Park
2026-02-23 12:32 ` [RFC PATCH v3 3/4] mm/damon: add node_eligible_mem_bp and node_ineligible_mem_bp goal metrics Ravi Jonnalagadda
2026-02-24 4:27 ` SeongJae Park
2026-02-23 12:32 ` [RFC PATCH v4 4/4] mm/damon: add PA-mode cache for eligible memory detection lag Ravi Jonnalagadda
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=20260224014011.56624-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=ajayjoshi@micron.com \
--cc=akpm@linux-foundation.org \
--cc=bijan311@gmail.com \
--cc=corbet@lwn.net \
--cc=damon@lists.linux.dev \
--cc=honggyu.kim@sk.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ravis.opensrc@gmail.com \
--cc=yunjeong.mun@sk.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