]> git.baikalelectronics.ru Git - kernel.git/commit
ipvs: remove rs_lock by using RCU
authorJulian Anastasov <ja@ssi.bg>
Thu, 21 Mar 2013 09:58:08 +0000 (11:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Apr 2013 22:23:43 +0000 (00:23 +0200)
commitf4702d8e7f00d8735dbc156ba5dba189cb858ad1
tree666e19bc85d1d9d87147aa657e40f3868984be32
parent9168c8722d182cb6fdc87cc3c41dc9e9e872abb9
ipvs: remove rs_lock by using RCU

rs_lock was used to protect rs_table (hash table)
from updaters (under global mutex) and readers (packet handlers).
We can remove rs_lock by using RCU lock for readers. Reclaiming
dest only with kfree_rcu is enough because the readers access
only fields from the ip_vs_dest structure.

Use hlist for rs_table.

As we are now using hlist_del_rcu, introduce in_rs_table
flag as replacement for the list_empty checks which do not
work with RCU. It is needed because only NAT dests are in
the rs_table.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_ctl.c