summaryrefslogtreecommitdiff
path: root/net/rds
diff options
context:
space:
mode:
authorTom Parkin <tparkin@katalix.com>2021-11-26 16:09:03 +0000
committerDavid S. Miller <davem@davemloft.net>2021-11-29 12:11:25 +0000
commit07b8ca3792dec6bc3288b08ff85d80b5330de1d6 (patch)
treec81885305ce539395a579ca6e009d21ed4d7fdfe /net/rds
parent275f37ea50acdda09cc0863b8a0edcaaf1ae7f23 (diff)
net/l2tp: convert tunnel rwlock_t to rcu
Previously commit e02d494d2c60 ("l2tp: Convert rwlock to RCU") converted most, but not all, rwlock instances in the l2tp subsystem to RCU. The remaining rwlock protects the per-tunnel hashlist of sessions which is used for session lookups in the UDP-encap data path. Convert the remaining rwlock to rcu to improve performance of UDP-encap tunnels. Note that the tunnel and session, which both live on RCU-protected lists, use slightly different approaches to incrementing their refcounts in the various getter functions. The tunnel has to use refcount_inc_not_zero because the tunnel shutdown process involves dropping the refcount to zero prior to synchronizing RCU readers (via. kfree_rcu). By contrast, the session shutdown removes the session from the list(s) it is on, synchronizes with readers, and then decrements the session refcount. Since the getter functions increment the session refcount with the RCU read lock held we prevent getters seeing a zero session refcount, and therefore don't need to use refcount_inc_not_zero. Signed-off-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
0 files changed, 0 insertions, 0 deletions