On 7/10/24 6:43 PM, Christoph Lameter (Ampere) wrote: > On Wed, 10 Jul 2024, Vlastimil Babka wrote: > >>> With this patch cgroup restrictions memory policies etc etc no longer work >>> in the slab allocator. >> >> The only difference is memory policy from get_task_policy(), and the rest is >> the same, right? > > There are also the cpuset/cgroup restrictions via the zonelists that are > bypassed by removing alloc_pages() AFAICS cpusets are handled on a level that's reached by both paths, i.e. prepare_alloc_pages(), and I see nothing that would make switching to alloc_pages_node() bypass it. Am I missing something? >> But this only affects new slab page allocation, while getting objects from >> existing slabs isn't subject to memory policies, so now it's at least >> consistent? Do you have some use case where it matters? > > Yes this means you cannot redirect kmalloc based kernel metadata > allocation when creating f.e. cgroups for another NUMA node. This affects > all kernel metadata allocation during syscalls that used to be > controllable via numa methods. > > SLAB implemented memory allocations policies per object. SLUB moved that > to implement these policies only when allocating a page frame. If this > patch is left in then there wont be any support for memory allocation > policies left in the slab allocators. > > We have some internal patches now that implement memory policies on a per > object basis for SLUB here. > > This is a 10-15% regression on various benchmarks when objects like the > scheduler statistics structures are misplaced. I believe it would be best if you submitted a patch with with all that reasoning. Thanks!