VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Miaohe Lin <linmiaohe@huawei.com> 2021-10-18 15:16:06 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-10-18 20:22:03 -1000 commit: 3ddd60268c24bcac9d744404cc277e9dc52fe6b6 parent: 67823a544414def2a36c212abadb55b23bcda00c
Commit Summary:
mm, slub: fix incorrect memcg slab count for bulk free
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/mm/slub.c b/mm/slub.c
index f3df0f04a472..d8f77346376d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3420,7 +3420,9 @@ static __always_inline void do_slab_free(struct kmem_cache *s,
 	struct kmem_cache_cpu *c;
 	unsigned long tid;
 
-	memcg_slab_free_hook(s, &head, 1);
+	/* memcg_slab_free_hook() is already called for bulk free. */
+	if (!tail)
+		memcg_slab_free_hook(s, &head, 1);
 redo:
 	/*
 	 * Determine the currently cpus per cpu slab.