• Florian Westphal's avatar
    xfrm: policy: prepare policy_bydst hash for rcu lookups · e1e551bc
    Florian Westphal authored
    Since commit 56f04730
    ("xfrm: add rcu grace period in xfrm_policy_destroy()") xfrm policy
    objects are already free'd via rcu.
    
    In order to make more places lockless (i.e. use rcu_read_lock instead of
    grabbing read-side of policy rwlock) we only need to:
    
    - use rcu_assign_pointer to store address of new hash table backend memory
    - add rcu barrier so that freeing of old memory is delayed (expansion
      and free happens from system workqueue, so synchronize_rcu is fine)
    - use rcu_dereference to fetch current address of the hash table.
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
    e1e551bc
xfrm_policy.c 80 KB