From 9c150f6a7039218080e067e9955aac0f6a55a712 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 24 Dec 2010 19:16:20 -0800 Subject: [PATCH] tunnel: Drop spinlock around cache free. We hold a spinlock when freeing the cache, since you're generally supposed to do that when writing to RCU protected data. However, there's really no point in doing that here because the port has already been removed from both the transmit and receive side data structures and we've waited for an RCU grace period. In addition, we're about to free the port itself, which contains the spinlock and will be in trouble if anyone else is trying to access it. For clarity, drop the spinlock. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- datapath/tunnel.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/datapath/tunnel.c b/datapath/tunnel.c index ce1d8eb52..ee9e45d31 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1458,10 +1458,7 @@ static void free_port_rcu(struct rcu_head *rcu) { struct tnl_vport *tnl_vport = container_of(rcu, struct tnl_vport, rcu); - spin_lock_bh(&tnl_vport->cache_lock); free_cache(tnl_vport->cache); - spin_unlock_bh(&tnl_vport->cache_lock); - kfree(tnl_vport->mutable); vport_free(tnl_vport_to_vport(tnl_vport)); } -- 2.43.0