Skip to content

Commit 7bb3ecb

Browse files
JuliaLawallkuba-moo
authored andcommitted
kcm: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
Since SLOB was removed and since commit 6c6c47b ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"), it is not necessary to use call_rcu when the callback only performs kmem_cache_free. Use kfree_rcu() directly. The changes were made using Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4ac64e5 commit 7bb3ecb

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

net/kcm/kcmsock.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,14 +1584,6 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
15841584
return err;
15851585
}
15861586

1587-
static void free_mux(struct rcu_head *rcu)
1588-
{
1589-
struct kcm_mux *mux = container_of(rcu,
1590-
struct kcm_mux, rcu);
1591-
1592-
kmem_cache_free(kcm_muxp, mux);
1593-
}
1594-
15951587
static void release_mux(struct kcm_mux *mux)
15961588
{
15971589
struct kcm_net *knet = mux->knet;
@@ -1619,7 +1611,7 @@ static void release_mux(struct kcm_mux *mux)
16191611
knet->count--;
16201612
mutex_unlock(&knet->mutex);
16211613

1622-
call_rcu(&mux->rcu, free_mux);
1614+
kfree_rcu(mux, rcu);
16231615
}
16241616

16251617
static void kcm_done(struct kcm_sock *kcm)

0 commit comments

Comments
 (0)