[PATCH] fixup! mm, slab: move memcg charging to post-alloc hook
From: Vlastimil Babka
Date: Wed Apr 03 2024 - 11:45:15 EST
The call to memcg_alloc_abort_single() is wrong, it expects a pointer to
single object, not an array.
Reported-by: Aishwarya TCV <aishwarya.tcv@xxxxxxx>
Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index f5b151a58b7d..b32e79629ae7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2100,7 +2100,7 @@ bool memcg_slab_post_alloc_hook(struct kmem_cache *s, struct list_lru *lru,
return true;
if (likely(size == 1)) {
- memcg_alloc_abort_single(s, p);
+ memcg_alloc_abort_single(s, *p);
*p = NULL;
} else {
kmem_cache_free_bulk(s, size, p);
--
2.44.0