Skip to content

Commit

Permalink
ipv4: 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-3-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 1d30417 commit 497e17d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,9 @@ static const int inflate_threshold = 50;
static const int halve_threshold_root = 15;
static const int inflate_threshold_root = 30;

static void __alias_free_mem(struct rcu_head *head)
{
struct fib_alias *fa = container_of(head, struct fib_alias, rcu);
kmem_cache_free(fn_alias_kmem, fa);
}

static inline void alias_free_mem_rcu(struct fib_alias *fa)
{
call_rcu(&fa->rcu, __alias_free_mem);
kfree_rcu(fa, rcu);
}

#define TNODE_VMALLOC_MAX \
Expand Down

0 comments on commit 497e17d

Please sign in to comment.