From: SeongJae Park <sj@kernel.org>
To: Bijan Tabatabai <bijan311@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
damon@lists.linux.dev, akpm@linux-foundation.org,
Bijan Tabatabai <bijantabatab@micron.com>
Subject: Re: [PATCH] mm/damon/vaddr: Skip isolating folios already in destination nid
Date: Fri, 25 Jul 2025 12:36:37 -0700 [thread overview]
Message-ID: <20250725193637.49389-1-sj@kernel.org> (raw)
In-Reply-To: <20250725163300.4602-1-bijan311@gmail.com>
On Fri, 25 Jul 2025 11:33:00 -0500 Bijan Tabatabai <bijan311@gmail.com> wrote:
> From: Bijan Tabatabai <bijantabatab@micron.com>
>
> damos_va_migrate_dests_add() determines the node a folio should be in
> based on the struct damos_migrate_dests associated with the migration
> scheme and adds the folio to the linked list corresponding to that node
> so it can be migrated later. Currently, folios are isolated and added to
> the list even if they are already in the node they should be in.
>
> In using damon weighted interleave more, I've found that the overhead of
> needlessly adding these folios to the migration lists can be quite
> high. The overhead comes from isolating folios and placing them in the
> migration lists inside of damos_va_migrate_dests_add(), as well as the
> cost of handling those folios in damon_migrate_pages(). This patch
> eliminates that overhead by simply avoiding the addition of folios that
> are already in their intended location to the migration list.
[...]
> Signed-off-by: Bijan Tabatabai <bijantabatab@micron.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
> ---
> Sorry I missed this in the original patchset!
No worry!
Andrew, could we squash this into commit 19c1dc15c859 ("mm/damon/vaddr: use
damos->migrate_dests in migrate_{hot,cold}") on mm-stable? I think this is
just a simple fixup.
>
> mm/damon/vaddr.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index 7f5dc9c221a0..4404c2ab0583 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -711,6 +711,10 @@ static void damos_va_migrate_dests_add(struct folio *folio,
> target -= dests->weight_arr[i];
> }
>
> + /* If the folio is already in the right node, don't do anything */
> + if (folio_nid(folio) == dests->node_id_arr[i])
> + return;
> +
> isolate:
> if (!folio_isolate_lru(folio))
> return;
> --
> 2.43.5
Thanks,
SJ
next prev parent reply other threads:[~2025-07-25 19:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 16:33 [PATCH] mm/damon/vaddr: Skip isolating folios already in destination nid Bijan Tabatabai
2025-07-25 19:36 ` SeongJae Park [this message]
2025-07-25 19:39 ` SeongJae Park
2025-07-28 6:16 ` Raghavendra K T
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=20250725193637.49389-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bijan311@gmail.com \
--cc=bijantabatab@micron.com \
--cc=damon@lists.linux.dev \
--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 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).