[PATCH 2/2] mm: Use kvfree_rcu() in update_memcg_params()
From: Kirill Tkhai
Date: Tue Feb 06 2018 - 05:20:26 EST
Make update_memcg_params() to use generic kvfree_rcu()
helper and remove free_memcg_params() code.
Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
---
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;
}