]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, hugetlb: avoid passing a null nodemask when there is mbind policy
authorOscar Salvador <osalvador@suse.de>
Tue, 15 Apr 2025 12:15:03 +0000 (14:15 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:30 +0000 (17:48 -0700)
commit00ccf40ae298262feb13b3ad56b4428647f3aafa
tree5c682317886c10f75436c741c88748a73b34d89b
parentf736953e2b1f1d7096e70580180f98744c9c9c86
mm, hugetlb: avoid passing a null nodemask when there is mbind policy

Before trying to allocate a page, gather_surplus_pages() sets up a
nodemask for the nodes we can allocate from, but instead of passing the
nodemask down the road to the page allocator, it iterates over the nodes
within that nodemask right there, meaning that the page allocator will
receive a preferred_nid and a null nodemask.

This is a problem when using a memory policy, because it might be that the
page allocator ends up using a node as a fallback which is not represented
in the policy.

Avoid that by passing the nodemask directly to the page allocator, so it
can filter out fallback nodes that are not part of the nodemask.

Link: https://lkml.kernel.org/r/20250415121503.376811-1-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c