Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm, slab: restore NUMA policy support for large kmalloc

The slab allocator observes the task's NUMA policy in various places
such as allocating slab pages. Large kmalloc() allocations used to do
that too, until an unintended change by c4cab557521a ("mm/slab_common:
cleanup kmalloc_large()") resulted in ignoring mempolicy and just
preferring the local node. Restore the NUMA policy support.

Fixes: c4cab557521a ("mm/slab_common: cleanup kmalloc_large()")
Cc: <stable@vger.kernel.org>
Acked-by: Christoph Lameter (Ampere) <cl@gentwo.org>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

+6 -1
+6 -1
mm/slub.c
··· 4269 4269 flags = kmalloc_fix_flags(flags); 4270 4270 4271 4271 flags |= __GFP_COMP; 4272 - folio = (struct folio *)alloc_pages_node_noprof(node, flags, order); 4272 + 4273 + if (node == NUMA_NO_NODE) 4274 + folio = (struct folio *)alloc_pages_noprof(flags, order); 4275 + else 4276 + folio = (struct folio *)__alloc_pages_noprof(flags, order, node, NULL); 4277 + 4273 4278 if (folio) { 4274 4279 ptr = folio_address(folio); 4275 4280 lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B,