Skip to content

Commit

Permalink
ipv6: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
Browse files Browse the repository at this point in the history
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 <Julia.Lawall@inria.fr>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Link: https://patch.msgid.link/20241013201704.49576-5-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Julia Lawall authored and Jakub Kicinski committed Oct 15, 2024
1 parent bb5810d commit 85e48bc
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,9 @@ static void node_free_immediate(struct net *net, struct fib6_node *fn)
net->ipv6.rt6_stats->fib_nodes--;
}

static void node_free_rcu(struct rcu_head *head)
{
struct fib6_node *fn = container_of(head, struct fib6_node, rcu);

kmem_cache_free(fib6_node_kmem, fn);
}

static void node_free(struct net *net, struct fib6_node *fn)
{
call_rcu(&fn->rcu, node_free_rcu);
kfree_rcu(fn, rcu);
net->ipv6.rt6_stats->fib_nodes--;
}

Expand Down

0 comments on commit 85e48bc

Please sign in to comment.