Commit 5ca98c22 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents f896d1c0 e6c53ead
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -6689,8 +6689,12 @@ void slab_free(struct kmem_cache *s, struct slab *slab, void *object,
static noinline
void memcg_alloc_abort_single(struct kmem_cache *s, void *object)
{
	struct slab *slab = virt_to_slab(object);

	alloc_tagging_slab_free_hook(s, slab, &object, 1);

	if (likely(slab_free_hook(s, object, slab_want_init_on_free(s), false)))
		do_slab_free(s, virt_to_slab(object), object, object, 1, _RET_IP_);
		do_slab_free(s, slab, object, object, 1, _RET_IP_);
}
#endif