Re: [PATCH v2] mm/slub: Respect MPOL_BIND when taking remote partial slabs

From: Harry Yoo

Date: Wed Nov 25 2026 - 10:08:25 EST


On Thu, Nov 19, 2026 at 05:04:30PM +0100, Andrea Righi wrote:
> When the local node has no partial slabs, get_from_any_partial() and
> __refill_objects_any() take partial slabs from other nodes.

There's a tradeoff between memory usage and NUMA locality and the
kernel by default favours reducing memory usage.

This could be tuned by /sys/kernel/slab/<name>/remote_node_defrag_ratio.

> The scan
> only checks cpuset_zone_allowed(), not the task's mempolicy, so a task
> bound to a node with MPOL_BIND can get objects from nodes outside its
> policy, even though new slabs for it are allocated on the allowed nodes.
>
> slab_strict_numa doesn't help here: when the local node is in the bind
> mask, apply_strict_numa_policy() leaves the node as NUMA_NO_NODE and the
> allocation takes the same path.

This sounds like an issue to be fixed in slab_strict_numa?
NUMA_NO_NODE allocations should still honour the mempolicy, no?

--
Cheers,
Harry / Hyeonggon