From: SeongJae Park <sj@kernel.org>
To: wang lian <lianux.mm@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
akpm@linux-foundation.org, damon@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 08/11] mm/damon/lru_sort: support active:inactive memory ratio based auto-tuning
Date: Tue, 13 Jan 2026 21:53:07 -0800 [thread overview]
Message-ID: <20260114055308.79884-1-sj@kernel.org> (raw)
In-Reply-To: <20260114053629.85750-1-lianux.mm@gmail.com>
On Wed, 14 Jan 2026 13:36:28 +0800 wang lian <lianux.mm@gmail.com> wrote:
>
> > Doing DAMOS_LRU_[DE]PRIO with DAMOS_QUOTA_[IN]ACTIVE_MEM_BP based quota
> > auto-tuning can be easy and intuitive, compared to the manual
> > [de]prioritization target access pattern thresholds tuning. For
> > example, users can ask DAMON to "find hot/cold pages and
> > activate/deactivate those aiming 50:50 active:inactive memory size." But
> > DAMON_LRU_SORT has no interface to do that. Add a module parameter for
> > setting the target ratio.
>
> > Signed-off-by: SeongJae Park <sj@kernel.org>
>
> ```
> > +static int damon_lru_sort_add_quota_goals(struct damos *hot_scheme,
> > + struct damos *cold_scheme)
> > +{
> > struct damos_quota_goal *goal;
> > +
> > + if (!active_mem_bp)
> > + return 0;
> > + goal = damos_new_quota_goal(DAMOS_QUOTA_ACTIVE_MEM_BP, active_mem_bp);
> > + if (!goal)
> > + return -ENOMEM;
> > + damos_add_quota_goal(&hot_scheme->quota, goal);
> > + /* aim 0.2 % goal conflict, to keep little ping pong */
> > + goal = damos_new_quota_goal(DAMOS_QUOTA_INACTIVE_MEM_BP,
> > + 10000 - active_mem_bp + 2);
> > + if (!goal)
> > + return -ENOMEM;
> > + damos_add_quota_goal(&hot_scheme->quota, goal);
> > + return 0;
> > +}
>
> The second goal (Inactive ratio target) is added to hot_scheme again.
> Should this be cold_scheme? Currently the cold_scheme parameter appears to be unused.
You are right, thank you for catching this, Wang!
Andrew, could you please add below attaching fixup?
Thanks,
SJ
[...]
=== >8 ===
From c8dbbf0cfb01de606d47f455bccc2d7b2d6d07ef Mon Sep 17 00:00:00 2001
From: SeongJae Park <sj@kernel.org>
Date: Tue, 13 Jan 2026 21:48:53 -0800
Subject: [PATCH] mm/damon/lru_sort: add inactive mem ratio quota goal to
cold_scheme
damon_lru_sort_add_quota_goals() is adding inactive memory ratio quota
goal, which is for cold pages scheme, to hot pages scheme. Fix it.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/lru_sort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c
index f3a9dfc246b6..8af97642912a 100644
--- a/mm/damon/lru_sort.c
+++ b/mm/damon/lru_sort.c
@@ -238,7 +238,7 @@ static int damon_lru_sort_add_quota_goals(struct damos *hot_scheme,
10000 - active_mem_bp + 2);
if (!goal)
return -ENOMEM;
- damos_add_quota_goal(&hot_scheme->quota, goal);
+ damos_add_quota_goal(&cold_scheme->quota, goal);
return 0;
}
--
2.47.3
next prev parent reply other threads:[~2026-01-14 5:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
2026-01-13 15:27 ` [PATCH 01/11] mm/damon/core: introduce [in]active memory ratio damos quota goal metric SeongJae Park
2026-01-13 15:27 ` [PATCH 02/11] mm/damon/sysfs-schemes: support DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
2026-01-14 2:57 ` wang lian
2026-01-14 2:57 ` wang lian
2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
2026-01-14 2:51 ` wang lian
2026-01-13 15:27 ` [PATCH 04/11] mm/damon/paddr: activate DAMOS_LRU_PRIO targets instead of marking accessed SeongJae Park
2026-01-13 15:27 ` [PATCH 05/11] mm/damon/lru_sort: consider age for quota prioritization SeongJae Park
2026-01-13 15:27 ` [PATCH 06/11] mm/damon/lru_sort: support young page filters SeongJae Park
2026-01-13 15:27 ` [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages SeongJae Park
2026-01-14 3:25 ` wang lian
2026-01-13 15:27 ` [PATCH 08/11] mm/damon/lru_sort: support active:inactive memory ratio based auto-tuning SeongJae Park
2026-01-14 5:36 ` wang lian
2026-01-14 5:53 ` SeongJae Park [this message]
2026-01-13 15:27 ` [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter SeongJae Park
2026-01-14 6:05 ` wang lian
2026-01-13 15:27 ` [PATCH 10/11] mm/damon/lru_sort: add monitoring intervals auto-tuning parameter SeongJae Park
2026-01-14 6:27 ` wang lian
2026-01-13 15:27 ` [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning SeongJae Park
2026-01-14 6:30 ` wang lian
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=20260114055308.79884-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=lianux.mm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.