Skip to contentSkip to conversation

mm-memcg-slab-uncharge-during-kmem_cache_free_bulk.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 14, 2020 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: memcg/slab: uncharge during kmem_cache_free_bulk()
has been removed from the -mm tree. Its filename was
mm-memcg-slab-uncharge-during-kmem_cache_free_bulk.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Bharata B Rao <[email protected]>
Subject: mm: memcg/slab: uncharge during kmem_cache_free_bulk()

Object cgroup charging is done for all the objects during allocation, but during freeing, uncharging ends up happening for only one object in the case of bulk allocation/freeing.

Fix this by having a separate call to uncharge all the objects from kmem_cache_free_bulk() and by modifying memcg_slab_free_hook() to take care of bulk uncharging.

Fixes 964d4bd370d5 ("mm: memcg/slab: save obj_cgroup for non-root slab objects"
Cc Christoph Lameter <[email protected]>
Cc David Rientjes <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tejun Heo <[email protected]>

---

 mm/slab.c |    2 +-
 mm/slab.h |   50 +++++++++++++++++++++++++++++++-------------------
 mm/slub.c |    3 ++-
 3 files changed, 34 insertions(+), 21 deletions(-)
mm/slab.c renamed from mm/slab.c~mm-memcg-slab-uncharge-during-kmem_cache_free_bulk +1 -1
@@ -3438,7 +3438,7 @@ void ___cache_free(struct kmem_cache *ca
 		memset(objp, 0, cachep->object_size);
 	kmemleak_free_recursive(objp, cachep->flags);
 	objp = cache_free_debugcheck(cachep, objp, caller);
-	memcg_slab_free_hook(cachep, virt_to_head_page(objp), objp);
+	memcg_slab_free_hook(cachep, &objp, 1);
 
 	/*
 	 * Skip calling cache_free_alien() when the platform is not numa.
mm/slab.h renamed from mm/slab.h~mm-memcg-slab-uncharge-during-kmem_cache_free_bulk +31 -19

69 lines not on this page · raw message

mm/slub.c renamed from mm/slub.c~mm-memcg-slab-uncharge-during-kmem_cache_free_bulk +2 -1
@@ -3095,7 +3095,7 @@ static __always_inline void do_slab_free
 	struct kmem_cache_cpu *c;
 	unsigned long tid;
 
-	memcg_slab_free_hook(s, page, head);
+	memcg_slab_free_hook(s, &head, 1);
 redo:
 	/*
 	 * Determine the currently cpus per cpu slab.
@@ -3257,6 +3257,7 @@ void kmem_cache_free_bulk(struct kmem_ca
 	if (WARN_ON(!size))
 		return;
 
+	memcg_slab_free_hook(s, p, size);
 	do {
 		struct detached_freelist df;
 

_

Patches currently in -mm which might be from [email protected] are