[PATCH 15/22] mm/oom_kill: compare OOM constraints against common memory
From: Gregory Price (Meta)
Date: Sat Nov 14 2026 - 02:12:29 EST
Ordinary allocations reach only common-memory zonelists. Compare policy
and cpuset constraints against N_MEMORY_COMMON, so nodes outside it
neither make an otherwise global policy appear constrained nor inflate
the constrained capacity.
All memory is common at this point, so behavior is unchanged.
Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
mm/oom_kill.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 5d48bd862c27b..1ec22bdad1fd4 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -274,9 +274,9 @@ static enum oom_constraint constrained_alloc(struct oom_control *oc)
* get_page_from_freelist().
*/
if (oc->nodemask &&
- !nodes_subset(node_states[N_MEMORY], *oc->nodemask)) {
+ !nodes_subset(node_states[N_MEMORY_COMMON], *oc->nodemask)) {
oc->totalpages = total_swap_pages;
- for_each_node_mask(nid, *oc->nodemask)
+ for_each_node_mask_state(nid, *oc->nodemask, N_MEMORY_COMMON)
oc->totalpages += node_present_pages(nid);
return CONSTRAINT_MEMORY_POLICY;
}
@@ -289,7 +289,8 @@ static enum oom_constraint constrained_alloc(struct oom_control *oc)
if (cpuset_limited) {
oc->totalpages = total_swap_pages;
- for_each_node_mask(nid, cpuset_current_mems_allowed)
+ for_each_node_mask_state(nid, cpuset_current_mems_allowed,
+ N_MEMORY_COMMON)
oc->totalpages += node_present_pages(nid);
return CONSTRAINT_CPUSET;
}
--
2.53.1-Meta