Skip to content

xfrm: convert xfrm_state_find to rcu

Florian Westphal netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6xfrm: state: use hlist_for_each_entry_rcu helpernet/xfrm/xfrm_state.c+19 -190 replies
2/6xfrm: state: use atomic_inc_not_zero to increment refcountnet/xfrm/xfrm_state.c+16 -50 replies
3/6xfrm: state: delay freeing until rcu grace period has elapsednet/xfrm/xfrm_state.c+5 -00 replies
4/6xfrm: state: add sequence count to detect hash resizesnet/xfrm/xfrm_state.c+15 -00 replies
5/6xfrm: state: use rcu_deref and assign_pointer helpersnet/xfrm/xfrm_state.c+10 -80 replies
6/6xfrm: state: don't use lock anymore unless acquire operation is neededinclude/net/netns/xfrm.h net/xfrm/xfrm_state.c+7 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/6] xfrm: convert xfrm_state_find to rcu

This series converts state_by{dst,src,spi} to allow lookups without holding xfrm_state_lock.

Only xfrm_state_find() is converted here for the (more common) case where we do not query key manager.

Once more flows are created/destroyed (or the flow cache is overloaded and often cleans out other entries) this function (and the state lock) start to show up in perf.

Florian Westphal (6):
xfrm: state: use hlist_for_each_entry_rcu helper
xfrm: state: use atomic_inc_not_zero to increment refcount
xfrm: state: delay freeing until rcu grace period has elapsed
xfrm: state: add sequence count to detect hash resizes
xfrm: state: use rcu_deref and assign_pointer helpers
xfrm: state: don't use lock anymore unless acquire operation is needed

 include/net/netns/xfrm.h |    6 +-
 net/xfrm/xfrm_state.c    |  103 +++++++++++++++++++++++++++++++----------------
 2 files changed, 72 insertions(+), 37 deletions(-)

NB: I have a similar patch series for the policy rwlock, I will send it once/if this series is applied.