From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,ziy@nvidia.com,ying.huang@linux.alibaba.com,
sj@kernel.org,rakie.kim@sk.com,joshua.hahnjy@gmail.com,david@kernel.org,
gourry@gourry.net,akpm@linux-foundation.org
Subject: + mm-mempolicy-ignore-a-bind-policy-whose-nodes-have-no-memory.patch added to mm-new branch
Date: Fri, 13 Nov 2026 18:16:25 -0800 [thread overview]
Message-ID: <20261114021626.2A5441F000C4@smtp.kernel.org> (raw)
The patch titled
Subject: mm/mempolicy: ignore a bind policy whose nodes have no memory
has been added to the -mm mm-new branch. Its filename is
mm-mempolicy-ignore-a-bind-policy-whose-nodes-have-no-memory.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mempolicy-ignore-a-bind-policy-whose-nodes-have-no-memory.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Gregory Price (Meta)" <gourry@gourry.net>
Subject: mm/mempolicy: ignore a bind policy whose nodes have no memory
Date: Fri, 13 Nov 2026 14:26:42 -0500
apply_policy_zone() assumes that policy->nodes intersects N_MEMORY, so
it reads a bind policy with no N_HIGH_MEMORY node as movable-only.
On systems with CONFIG_CPUSETS=n, nothing rebinds policies when memory
is removed, so offlining all memory on the nodes a bind policy names
leaves it with none. The policy is then treated as movable-only, and
movable allocations are restricted to nodes without memory.
This results in allocations failures, a VM_FAULT_OOM leak, and then
an infinitely retrying fault that hangs the process.
page allocation failure: order:0, mode:0x140dca ... nodemask=2
Huh VM_FAULT_OOM leaked out to the #PF handler. Retrying PF
Ignore a bind policy whose nodes have no memory. policy_nodemask()
already ignores a bind policy that does not intersect the cpuset.
This covers hugetlb's policy_mbind_nodemask() as well.
If the nodes regain memory, the policy applies again.
CPUSETS=n with HOTREMOVE=y is unlikely a common configuration, so this
isn't marked for stable.
Link: https://lore.kernel.org/20261113192642.2618878-1-gourry@gourry.net
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
---
mm/mempolicy.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/mm/mempolicy.c~mm-mempolicy-ignore-a-bind-policy-whose-nodes-have-no-memory
+++ a/mm/mempolicy.c
@@ -2100,6 +2100,10 @@ bool apply_policy_zone(struct mempolicy
BUG_ON(dynamic_policy_zone == ZONE_MOVABLE);
+ /* Memory hot-remove can leave policy->nodes without memory. */
+ if (!nodes_intersects(policy->nodes, node_states[N_MEMORY]))
+ return false;
+
/*
* if policy->nodes has movable memory only,
* we apply policy when gfp_zone(gfp) = ZONE_MOVABLE only.
_
Patches currently in -mm which might be from gourry@gourry.net are
mm-memory-tiers-reset-demotion-targets-of-nodes-without-memory.patch
mm-mempolicy-convert-mempolicy-refcnt-to-refcount_t.patch
selftests-mm-add-madv_cold-and-madv_pageout-contract-tests.patch
selftests-mm-check-madv_cold-and-madv_pageout-range-handling.patch
selftests-mm-check-that-madv_cold-and-madv_pageout-reject-hugetlb.patch
selftests-mm-check-that-madv_cold-and-madv_pageout-preserve-shared-memory.patch
selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps.patch
selftests-mm-check-madv_pageout-file-permissions.patch
selftests-mm-check-that-unauthorized-madv_pageout-skips-large-file-folios.patch
mm-mempolicy-ignore-a-bind-policy-whose-nodes-have-no-memory.patch
mm-hmm-reject-shadow-stack-mappings.patch
reply other threads:[~2026-11-14 2:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261114021626.2A5441F000C4@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=mm-commits@vger.kernel.org \
--cc=rakie.kim@sk.com \
--cc=sj@kernel.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 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.