linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jinjiang Tu <tujinjiang@huawei.com>
Cc: <akpm@linuxfoundation.org>, <david@kernel.org>, <ziy@nvidia.com>,
	<matthew.brost@intel.com>, <joshua.hahnjy@gmail.com>,
	<rakie.kim@sk.com>, <byungchul@sk.com>, <gourry@gourry.net>,
	<ying.huang@linux.alibaba.com>, <apopple@nvidia.com>,
	<mgorman@suse.de>, <linux-mm@kvack.org>,
	<wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v3] mm/mempolicy: fix mpol_rebind_nodemask() for MPOL_F_NUMA_BALANCING
Date: Tue, 13 Jan 2026 16:37:39 -0800	[thread overview]
Message-ID: <20260113163739.902aade0c1b474723e20de86@linux-foundation.org> (raw)
In-Reply-To: <25e3d755-4d4d-48c5-b1ac-ff62d37694dd@huawei.com>

On Tue, 13 Jan 2026 09:52:42 +0800 Jinjiang Tu <tujinjiang@huawei.com> wrote:

> 
> 在 2025/12/23 19:05, Jinjiang Tu 写道:
> > commit bda420b98505 ("numa balancing: migrate on fault among multiple
> > bound nodes") adds new flag MPOL_F_NUMA_BALANCING to enable NUMA balancing
> > for MPOL_BIND memory policy.
> >
> > When the cpuset of tasks changes, the mempolicy of the task is rebound by
> > mpol_rebind_nodemask(). When MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES
> > are both not set, the behaviour of rebinding should be same whenever
> > MPOL_F_NUMA_BALANCING is set or not. So, when an application calls
> > set_mempolicy() with MPOL_F_NUMA_BALANCING set but both MPOL_F_STATIC_NODES
> > and MPOL_F_RELATIVE_NODES cleared, mempolicy.w.cpuset_mems_allowed should
> > be set to cpuset_current_mems_allowed nodemask. However, in current
> > implementation, mpol_store_user_nodemask() wrongly returns true, causing
> > mempolicy->w.user_nodemask to be incorrectly set to the user-specified
> > nodemask. Later, when the cpuset of the application changes,
> > mpol_rebind_nodemask() ends up rebinding based on the user-specified
> > nodemask rather than the cpuset_mems_allowed nodemask as intended.
> >
> > To fix this, only set mempolicy->w.user_nodemask to the user-specified
> > nodemask if MPOL_F_STATIC_NODES or MPOL_F_RELATIVE_NODES is present.
> >
> > Fixes: bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes")
> > Reviewed-by: Gregory Price <gourry@gourry.net>
> > Reviewed-by: Huang Ying <ying.huang@linux.alibaba.com>
> > Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
> > ---
> > Change in v3:
> >   * update changelog
> >   * collect RB from Huang Ying
> 
> Hi, Andrew
> 
> This patch has been reviewed, could you queue this patch into mm branch?

It has been in mm.git since Dec 23 ;)

The changelog led me to believe that earlier (-stable) kernels don't
need this fix.  Maybe that was wrong?


  reply	other threads:[~2026-01-14  0:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 11:05 Jinjiang Tu
2026-01-13  1:52 ` Jinjiang Tu
2026-01-14  0:37   ` Andrew Morton [this message]
2026-01-14  1:23     ` Jinjiang Tu

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=20260113163739.902aade0c1b474723e20de86@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=akpm@linuxfoundation.org \
    --cc=apopple@nvidia.com \
    --cc=byungchul@sk.com \
    --cc=david@kernel.org \
    --cc=gourry@gourry.net \
    --cc=joshua.hahnjy@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=matthew.brost@intel.com \
    --cc=mgorman@suse.de \
    --cc=rakie.kim@sk.com \
    --cc=tujinjiang@huawei.com \
    --cc=wangkefeng.wang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox