Skip to content

Commit 4ac64e5

Browse files
JuliaLawallkuba-moo
authored andcommitted
net: bridge: 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: Nikolay Aleksandrov <[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 85e48bc commit 4ac64e5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

net/bridge/br_fdb.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ static inline int has_expired(const struct net_bridge *br,
7373
time_before_eq(fdb->updated + hold_time(br), jiffies);
7474
}
7575

76-
static void fdb_rcu_free(struct rcu_head *head)
77-
{
78-
struct net_bridge_fdb_entry *ent
79-
= container_of(head, struct net_bridge_fdb_entry, rcu);
80-
kmem_cache_free(br_fdb_cache, ent);
81-
}
82-
8376
static int fdb_to_nud(const struct net_bridge *br,
8477
const struct net_bridge_fdb_entry *fdb)
8578
{
@@ -329,7 +322,7 @@ static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f,
329322
if (test_and_clear_bit(BR_FDB_DYNAMIC_LEARNED, &f->flags))
330323
atomic_dec(&br->fdb_n_learned);
331324
fdb_notify(br, f, RTM_DELNEIGH, swdev_notify);
332-
call_rcu(&f->rcu, fdb_rcu_free);
325+
kfree_rcu(f, rcu);
333326
}
334327

335328
/* Delete a local entry if no other port had the same address.

0 commit comments

Comments
 (0)