From: Honggyu Kim <honggyu.kim@sk.com>
To: wangchuanguo <wangchuanguo@inspur.com>,
akpm@linux-foundation.org, hannes@cmpxchg.org, sj@kernel.org
Cc: kernel_team@skhynix.com, david@redhat.com, mhocko@kernel.org,
zhengqi.arch@bytedance.com, shakeel.butt@linux.dev,
lorenzo.stoakes@oracle.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH 2/2] mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes
Date: Mon, 9 Jun 2025 21:30:53 +0900 [thread overview]
Message-ID: <74a7db85-8fcc-4bd5-8656-0f4d0670f205@sk.com> (raw)
In-Reply-To: <20250528111038.18378-3-wangchuanguo@inspur.com>
Hi Simon and SeongJae,
Sorry for the late response.
On 5/28/2025 8:10 PM, wangchuanguo wrote:
> This patch adds use_nodes_of_tier under
> /sys/kernel/mm/damon/admin/kdamonds/<N>/contexts/<N>/schemes/<N>/
>
> The 'use_nodes_of_tier' can be used to select nodes within the same memory
> tier of target_nid for DAMOS actions such as DAMOS_MIGRATE_{HOT,COLD}.
>
> Signed-off-by: wangchuanguo <wangchuanguo@inspur.com>
> ---
> include/linux/damon.h | 9 ++++++++-
> include/linux/memory-tiers.h | 5 +++++
> mm/damon/core.c | 6 ++++--
> mm/damon/lru_sort.c | 3 ++-
> mm/damon/paddr.c | 19 ++++++++++++-------
> mm/damon/reclaim.c | 3 ++-
> mm/damon/sysfs-schemes.c | 31 ++++++++++++++++++++++++++++++-
> mm/memory-tiers.c | 13 +++++++++++++
> samples/damon/mtier.c | 3 ++-
> samples/damon/prcl.c | 3 ++-
> 10 files changed, 80 insertions(+), 15 deletions(-)
[...snip...]
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index e8464f7e0014..e13321cff38f 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -383,7 +383,7 @@ static unsigned long damon_pa_deactivate_pages(struct damon_region *r,
>
> static unsigned int __damon_pa_migrate_folio_list(
> struct list_head *migrate_folios, struct pglist_data *pgdat,
> - int target_nid)
> + int target_nid, bool use_nodes_of_tier)
> {
> unsigned int nr_succeeded = 0;
> nodemask_t allowed_mask = NODE_MASK_NONE;
> @@ -405,6 +405,9 @@ static unsigned int __damon_pa_migrate_folio_list(
> if (list_empty(migrate_folios))
> return 0;
>
> + if (use_nodes_of_tier)
> + allowed_mask = get_tier_nodemask(target_nid);
I have a concern about this part. This might work but, IMHO, the current memory
tier doesn't provide a concept of cross socket bridge, which is UPI in Intel.
For example, please see the following topology.
node0 node1
+-------+ UPI +-------+
| CPU 0 |-------| CPU 1 |
+-------+ +-------+
| DRAM0 | | DRAM1 | <-- memory tier 0
+---+---+ +---+---+
| |
+---+---+ +---+---+
| CXL 0 | | CXL 1 | <-- memory tier 1
+---+---+ +---+---+
node2 node3
Even if some nodes are in the same memory tier, but if those are in the
different socket side, then the migratio makes the situation worse unexpectedly.
For example, if the page at node0 is tried to be demoted to node2, but if node2
is full then the current behavior is to cancel the demotion, but this change
makes it to be demoted to node3, which is on the other side of socket.
Since the cross socket access is a lot worse, I worry about this change.
Please let me know if you have a different thought.
Thanks,
Honggyu
next prev parent reply other threads:[~2025-06-09 12:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 11:10 [PATCH 0/2] add a knob to control whether to use other nodes at the same tier of the target node in DAMON wangchuanguo
2025-05-28 11:10 ` [PATCH 1/2] mm: migrate: restore the nmask after successfully allocating on the target node wangchuanguo
2025-05-28 22:09 ` SeongJae Park
2025-05-28 11:10 ` [PATCH 2/2] mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes wangchuanguo
2025-05-28 21:33 ` kernel test robot
2025-05-28 22:31 ` SeongJae Park
2025-06-09 12:30 ` Honggyu Kim [this message]
2025-05-28 22:39 ` [PATCH 0/2] add a knob to control whether to use other nodes at the same tier of the target node in DAMON SeongJae Park
2025-05-29 3:12 [PATCH 2/2] mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes Simon Wang (王传国)
2025-05-29 16:46 ` SeongJae Park
2025-05-30 8:04 Simon Wang (王传国)
2025-05-30 19:40 ` SeongJae Park
2025-06-03 3:05 ` wangchuanguo
2025-06-05 18:20 ` SeongJae Park
2025-06-09 12:39 ` Honggyu Kim
2025-06-09 19:13 ` 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=74a7db85-8fcc-4bd5-8656-0f4d0670f205@sk.com \
--to=honggyu.kim@sk.com \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=kernel_team@skhynix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=sj@kernel.org \
--cc=wangchuanguo@inspur.com \
--cc=zhengqi.arch@bytedance.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
all inboxes | Powered by JetHome®