mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Li Zhe" <lizhe.67@bytedance.com>
To: "Gregory Price" <gourry@gourry.net>
Cc: <akpm@linux-foundation.org>, <david@kernel.org>, <ljs@kernel.org>,
	 <liam@infradead.org>, <rppt@kernel.org>, <mhocko@suse.com>,
	 <corbet@lwn.net>, <skhan@linuxfoundation.org>, <ziy@nvidia.com>,
	 <joshua.hahnjy@gmail.com>, <ying.huang@linux.alibaba.com>,
	 <apopple@nvidia.com>, <linux-mm@kvack.org>,
	<linux-doc@vger.kernel.org>,  <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/numa_balancing: allow migrate on protnone reference with MPOL_WEIGHTED_INTERLEAVE policy
Date: Fri, 2 Oct 2026 15:25:54 +0800	[thread overview]
Message-ID: <93721275-3b50-49a5-9c4a-37bc181a098d@bytedance.com> (raw)
In-Reply-To: <arz-iKWj1gRO3ALw@gourry-fedora-PF4VCD3F>

On 9/30/26 8:25 PM, Gregory Price wrote:
> On Wed, Sep 30, 2026 at 07:22:10PM +0800, Li Zhe wrote:
>> Yes, that makes sense to me.
>>
>> I do not see a reason to keep the MPOL_F_MORON handling limited to
>> specific policy cases. The flag already means that migrate-on-fault
>> placement should target the accessing CPU's node, and the nodemask check
>> is the common constraint we want for all policies that opt in to this
>> behavior.
>>
>> I will rework v2 to handle MPOL_F_MORON before the policy-specific
>> switch. Then the switch can remain responsible for the non-MPOL_F_MORON
>> misplaced logic, while MPOL_BIND, MPOL_PREFERRED_MANY, MPOL_INTERLEAVE
>> and MPOL_WEIGHTED_INTERLEAVE can share the same migrate-on-fault path.
>>
> I do think it's worth breaking this up a bit, we can decide whether we
> want to apply it to interleave separate of the larger change.
>
> there is also slightly different behavior for task-mempolicy and
> vma-mempolicy, because vma-mempolicy applies interleave via index while
> task mempolicy does it based on a rolling counter, so you'll want to
> think about what happens on repeated faults
>
> i.e.
>
> 1) fault in a VMA interleaved based on idx
> 2) a bunch of tiering and pageout/swap happens
> 3) we fault a page back in based on idx - that means this page is
>     forever-faulted onto that location rather than taking that as an
>     indication that maybe it should be local
>
> Maybe we're ok with that, but we should probably think about it a bit.
>
> We may also want to limit this based on NUMA balancing being in tiering
> mode vs normal mode.  This only makes sense in tiering mode, in my
> opinion.  In normal mode i'm not sure it makes as much sense - and
> that's probably where this all came from.
>
> tl;dr: If we want to change this behavior for interleave, we should
> probably give more thought for how it should apply more generally
> instead of just hacking on support to one or two modes.
Agreed. I think this is the right direction.

The repeated-fault case for VMA interleave is a good example of why
simply enabling one or two modes could bake in odd semantics. I do not
have a good generic answer for that yet. Although we might be OK with
that behavior, it deserves more thought before being folded into the
interface.

I also agree that the current motivation fits memory tiering better than
normal NUMA balancing. For the next step, I will take a step back and
think more carefully about how migrate-on-fault should apply more
generally, especially around the boundary between memory tiering and
normal NUMA balancing.

Thanks,
Zhe

>
> ~Gregory

  reply	other threads:[~2026-10-02  7:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  7:26 Li Zhe
2026-09-30  8:43 ` Gregory Price
2026-09-30  8:59   ` Li Zhe
2026-09-30  9:11     ` Gregory Price
2026-09-30 10:59       ` Joshua Hahn
2026-09-30 11:22       ` Li Zhe
2026-09-30 12:25         ` Gregory Price
2026-10-02  7:25           ` Li Zhe [this message]
2026-09-30 11:26 ` David Hildenbrand (Arm)
2026-09-30 11:52   ` Li Zhe
2026-09-30 12:11     ` Joshua Hahn
2026-09-30 14:02       ` Li Zhe
2026-09-30 14:50         ` Gregory Price
2026-09-30 15:10           ` Zi Yan
2026-10-01 10:54             ` David Hildenbrand (Arm)
2026-10-01 11:18               ` Zi Yan
2026-10-01 13:26               ` Gregory Price
2026-10-02  7:56                 ` David Hildenbrand (Arm)
2026-10-02  8:15                   ` Li Zhe
2026-10-02 12:05                     ` Gregory Price
2026-09-30 12:03   ` Gregory Price
2026-09-30 12:32     ` David Hildenbrand (Arm)
2026-09-30 13:40       ` Gregory Price
2026-10-01 10:55         ` David Hildenbrand (Arm)

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=93721275-3b50-49a5-9c4a-37bc181a098d@bytedance.com \
    --to=lizhe.67@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=corbet@lwn.net \
    --cc=david@kernel.org \
    --cc=gourry@gourry.net \
    --cc=joshua.hahnjy@gmail.com \
    --cc=liam@infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --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 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®