Merge tag 'slab-for-6.19-rc8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab

Pull slab fix from Vlastimil Babka:
"A stable fix for memory allocation profiling tag not being cleared
when aborting an allocation due to memcg charge failure (Hao Ge)"

* tag 'slab-for-6.19-rc8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
mm/slab: Add alloc_tagging_slab_free_hook for memcg_alloc_abort_single

+5 -1
+5 -1
mm/slub.c
··· 6689 static noinline 6690 void memcg_alloc_abort_single(struct kmem_cache *s, void *object) 6691 { 6692 if (likely(slab_free_hook(s, object, slab_want_init_on_free(s), false))) 6693 - do_slab_free(s, virt_to_slab(object), object, object, 1, _RET_IP_); 6694 } 6695 #endif 6696
··· 6689 static noinline 6690 void memcg_alloc_abort_single(struct kmem_cache *s, void *object) 6691 { 6692 + struct slab *slab = virt_to_slab(object); 6693 + 6694 + alloc_tagging_slab_free_hook(s, slab, &object, 1); 6695 + 6696 if (likely(slab_free_hook(s, object, slab_want_init_on_free(s), false))) 6697 + do_slab_free(s, slab, object, object, 1, _RET_IP_); 6698 } 6699 #endif 6700