From: SeongJae Park <sj@kernel.org>
To: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
Bijan Tabatabai <bijan311@gmail.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
david@redhat.com, ziy@nvidia.com, matthew.brost@intel.com,
rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net,
ying.huang@linux.alibaba.com, apopple@nvidia.com,
bijantabatab@micron.com, venkataravis@micron.com,
emirakhur@micron.com, ajayjoshi@micron.com,
vtavarespetr@micron.com
Subject: Re: [RFC PATCH v2 2/2] mm/damon/paddr: Allow multiple migrate targets
Date: Mon, 23 Jun 2025 09:50:04 -0700 [thread overview]
Message-ID: <20250623165004.43394-1-sj@kernel.org> (raw)
In-Reply-To: <20250623140808.2479244-1-joshua.hahnjy@gmail.com>
On Mon, 23 Jun 2025 07:08:07 -0700 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:
> On Sat, 21 Jun 2025 11:11:27 -0700 SeongJae Park <sj@kernel.org> wrote:
>
> > On Sat, 21 Jun 2025 11:02:15 -0700 SeongJae Park <sj@kernel.org> wrote:
> >
> > [...]
> > > I'd hence suggest to implement and use a simple weights handling mechanism
> > > here. It could be roud-robin way, like weighted interleaving, or probabilistic
> > > way, using damon_rand().
> > >
> > > The round-robin way may be simpler in my opinion. For example,
>
> [...snip...]
>
> > Actually, probabilistic way may be not that complicated. Maybe we could to
> > below here.
>
> [...snip...]
>
> > But damon_rand() might be more expensive than the roud-robin way, and arguably
> > roud-robin way is what usrs who familiar with weighted interleaving may easily
> > expect and even prefer? I have no preferrence here.
>
> Hi SJ,
>
> If you have no preference here, I would like to add some thoughts : -)
>
[...]
> I think that code complexity aside, round-robin may be the better choice for
> a few reasons. Like you mentioned, I think it is what users might be used to,
> if they are coming from weighted interleave code. Also, I think a round-robin
> way will prevent worst-case scenarios where we get a long stretch of allocations
> on the "wrong" node (but maybe this isn't a big deal, since it is so unlikely).
>
> Finaly -- If we run workloads with mempolicy wet to weighted interleave
> *and* with the weights already set, then pages will be allocated in a
> round-robin fashion. I think it may be best to try and minimize migration costs
> by trying to keep these weights in-sync. That is, if we have a 2:1 ratio,
> we will have the following allocation:
>
> node0 | oo oo oo oo oo oo oo ...
> node1 | o o o o o o ...
>
> Using a probabilistic migration, it might change the pattern:
>
> node0 | oooo oo o ooo oo ...
> node1 | oo o o o o ...
>
> That is, the ratio might be preserved, but we may be doing unnecessary
> migrations, since a probabilistic allocation isn't aware of any underlying
> patterns. With a round-robin allocation, we have a 1/total_weight chance that
> there will be no additional migrations, depending on where the round-robin
> begins. I also want to note that weighted interleave auto-tuning is written
> to minimize total_weight.
>
> I'm wondering what you think about this. Perhaps there is a way to know where
> the "beginning" of round-robin should begin, so that we try to keep the
> allocation & migration pattern as in-sync as possible? I have a suspicion
> that I am way over-thinking this, and none of this really has a tangible
> impact on performance as well ;)
The theory makes sense to me. I also not very sure how much visible difference
it will make on large scale real workloads, though. Since at least the theory
makes sense and we show no risk, I think taking the round-robin appraoch would
be a saner action, unless we find other opinions or test results.
>
> Thank you as always SJ, have a great day!!
Thank you, you too!
Thanks,
SJ
[...]
next prev parent reply other threads:[~2025-06-23 16:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 18:04 [RFC PATCH v2 0/2] mm/damon/paddr: Allow interleaving in migrate_{hot,cold} actions Bijan Tabatabai
2025-06-20 18:04 ` [RFC PATCH v2 1/2] mm/mempolicy: Expose get_il_weight() to MM Bijan Tabatabai
2025-06-23 19:06 ` Gregory Price
2025-06-23 19:14 ` David Hildenbrand
2025-06-23 19:38 ` Gregory Price
2025-06-24 10:58 ` Huang, Ying
2025-06-20 18:04 ` [RFC PATCH v2 2/2] mm/damon/paddr: Allow multiple migrate targets Bijan Tabatabai
2025-06-21 18:02 ` SeongJae Park
2025-06-21 18:11 ` SeongJae Park
2025-06-23 14:08 ` Joshua Hahn
2025-06-23 16:50 ` SeongJae Park [this message]
2025-06-23 14:27 ` Bijan Tabatabai
2025-06-23 16:52 ` SeongJae Park
2025-06-23 14:16 ` Bijan Tabatabai
2025-06-23 17:52 ` SeongJae Park
2025-06-23 23:15 ` Bijan Tabatabai
2025-06-24 0:34 ` SeongJae Park
2025-06-24 16:01 ` Bijan Tabatabai
2025-06-24 22:33 ` SeongJae Park
2025-06-20 20:21 ` [RFC PATCH v2 0/2] mm/damon/paddr: Allow interleaving in migrate_{hot,cold} actions SeongJae Park
2025-06-20 21:47 ` Bijan Tabatabai
2025-06-20 23:13 ` SeongJae Park
2025-06-21 17:36 ` SeongJae Park
2025-06-23 14:39 ` Bijan Tabatabai
2025-06-23 16:32 ` SeongJae Park
2025-06-23 19:28 ` Gregory Price
2025-06-23 23:21 ` Bijan Tabatabai
2025-06-26 19:13 ` Gregory Price
2025-06-23 13:45 ` Joshua Hahn
2025-06-23 14:57 ` Bijan Tabatabai
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=20250623165004.43394-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=ajayjoshi@micron.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=bijan311@gmail.com \
--cc=bijantabatab@micron.com \
--cc=byungchul@sk.com \
--cc=damon@lists.linux.dev \
--cc=david@redhat.com \
--cc=emirakhur@micron.com \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=rakie.kim@sk.com \
--cc=venkataravis@micron.com \
--cc=vtavarespetr@micron.com \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.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 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.