]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfrm: state: do not acquire lock in get_mtu helpers
authorFlorian Westphal <fw@strlen.de>
Thu, 5 Jan 2017 12:23:58 +0000 (13:23 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 6 Jan 2017 07:44:56 +0000 (08:44 +0100)
commitb3b73b8e6df685ba61476b256f98eff1d650c199
tree3785a332fdcb2995299e0c8bc9a80458ba7ec747
parent1365e547c6bb6b6b137bc40a189675503baa037b
xfrm: state: do not acquire lock in get_mtu helpers

Once flow cache gets removed the mtu initialisation happens for every skb
that gets an xfrm attached, so this lock starts to show up in perf.

It is not obvious why this lock is required -- the caller holds
reference on the state struct, type->destructor is only called from the
state gc worker (all state structs on gc list must have refcount 0).

xfrm_init_state already has been called (else private data accessed
by type->get_mtu() would not be set up).

So just remove the lock -- the race on the state (DEAD?) doesn't
matter (could change right after dropping the lock too).

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c