mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 01:54:00 +00:00
inetpeer: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
Since SLOB was removed and since commit 6c6c47b063b5 ("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-4-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
497e17d807
commit
bb5810d423
@ -128,11 +128,6 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void inetpeer_free_rcu(struct rcu_head *head)
|
|
||||||
{
|
|
||||||
kmem_cache_free(peer_cachep, container_of(head, struct inet_peer, rcu));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* perform garbage collect on all items stacked during a lookup */
|
/* perform garbage collect on all items stacked during a lookup */
|
||||||
static void inet_peer_gc(struct inet_peer_base *base,
|
static void inet_peer_gc(struct inet_peer_base *base,
|
||||||
struct inet_peer *gc_stack[],
|
struct inet_peer *gc_stack[],
|
||||||
@ -168,7 +163,7 @@ static void inet_peer_gc(struct inet_peer_base *base,
|
|||||||
if (p) {
|
if (p) {
|
||||||
rb_erase(&p->rb_node, &base->rb_root);
|
rb_erase(&p->rb_node, &base->rb_root);
|
||||||
base->total--;
|
base->total--;
|
||||||
call_rcu(&p->rcu, inetpeer_free_rcu);
|
kfree_rcu(p, rcu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,7 +237,7 @@ void inet_putpeer(struct inet_peer *p)
|
|||||||
WRITE_ONCE(p->dtime, (__u32)jiffies);
|
WRITE_ONCE(p->dtime, (__u32)jiffies);
|
||||||
|
|
||||||
if (refcount_dec_and_test(&p->refcnt))
|
if (refcount_dec_and_test(&p->refcnt))
|
||||||
call_rcu(&p->rcu, inetpeer_free_rcu);
|
kfree_rcu(p, rcu);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(inet_putpeer);
|
EXPORT_SYMBOL_GPL(inet_putpeer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user