Thread (29 messages) 29 messages, 7 authors, 2018-02-22
STALE3077d

[PATCH 2/2] mm: Use kvfree_rcu() in update_memcg_params()

From: Kirill Tkhai <hidden>
Date: 2018-02-06 10:20:22
Also in: lkml
Subsystem: memory management, slab allocator, the rest · Maintainers: Andrew Morton, Vlastimil Babka, Harry Yoo, Linus Torvalds

Make update_memcg_params() to use generic kvfree_rcu()
helper and remove free_memcg_params() code.

Signed-off-by: Kirill Tkhai <redacted>
---
 mm/slab_common.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 10f127b2de7c..92d4a3a9471d 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -190,14 +190,6 @@ static void destroy_memcg_params(struct kmem_cache *s)
 		kvfree(rcu_access_pointer(s->memcg_params.memcg_caches));
 }
 
-static void free_memcg_params(struct rcu_head *rcu)
-{
-	struct memcg_cache_array *old;
-
-	old = container_of(rcu, struct memcg_cache_array, rcu);
-	kvfree(old);
-}
-
 static int update_memcg_params(struct kmem_cache *s, int new_array_size)
 {
 	struct memcg_cache_array *old, *new;
@@ -215,7 +207,7 @@ static int update_memcg_params(struct kmem_cache *s, int new_array_size)
 
 	rcu_assign_pointer(s->memcg_params.memcg_caches, new);
 	if (old)
-		call_rcu(&old->rcu, free_memcg_params);
+		kvfree_rcu(old, rcu);
 	return 0;
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help