summaryrefslogtreecommitdiff
path: root/scripts/stackusage
diff options
context:
space:
mode:
authorHao Li <hao.li@linux.dev>2026-06-24 18:00:14 +0800
committerVlastimil Babka (SUSE) <vbabka@kernel.org>2026-07-08 18:31:27 +0200
commit29b3b6cde5f2dee1c51a1c03ba2e0015e205125b (patch)
tree9077a7f22558d3cd83130101606007067df478f3 /scripts/stackusage
parentaf9ea231c0b4530edc389a3126a69e0699b7699d (diff)
downloadlinux-next-29b3b6cde5f2dee1c51a1c03ba2e0015e205125b.tar.gz
linux-next-29b3b6cde5f2dee1c51a1c03ba2e0015e205125b.zip
mm/slub: deduplicate NUMA policy calculation in allocation paths
Currently, alloc_from_pcs() and __slab_alloc_node() both calculate the NUMA policy independently. Since they are called consecutively in paths like __kmalloc_nolock_noprof() and slab_alloc_node(), this leads to redundant code snippets. Introduce a helper function to resolve the NUMA policy once, eliminating the duplicated code and reducing execution overhead. Also remove __slab_alloc_node() function because it is almost empty. The callers of __slab_alloc_node now call ___slab_alloc() directly. Additional notes: Previously, when slab_strict_numa was enabled, alloc_from_pcs() and __slab_alloc_node() could each resolve the task mempolicy, so MPOL_INTERLEAVE or MPOL_WEIGHTED_INTERLEAVE could advance the interleave state twice for a single object allocation attempt. And each retry will also advance the interleave state. With this change, the strict NUMA node is resolved once and reused by both alloc_from_pcs() and ___slab_alloc() in each retry. This is a behavior change, but it better matches the intent of selecting one policy node for one allocation attempt. Signed-off-by: Hao Li <hao.li@linux.dev> Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org> Link: https://patch.msgid.link/20260624100320.430115-1-hao.li@linux.dev Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions