]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ipvs: convert connection locking
authorJulian Anastasov <ja@ssi.bg>
Thu, 21 Mar 2013 09:58:10 +0000 (11:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Apr 2013 22:23:45 +0000 (00:23 +0200)
commit088339a57d6042a8a19a3d5794594b558cd7b624
tree835a3b82d7504f7f5670a7b130eedabf14d0ccc2
parent60b6aa3b319d902db49dbaee7433fe2ac7d0cdb5
ipvs: convert connection locking

Convert __ip_vs_conntbl_lock_array as follows:

- readers that do not modify conn lists will use RCU lock
- updaters that modify lists will use spinlock_t

Now for conn lookups we will use RCU read-side
critical section. Without using __ip_vs_conn_get such
places have access to connection fields and can
dereference some pointers like pe and pe_data plus
the ability to update timer expiration. If full access
is required we contend for reference.

We add barrier in __ip_vs_conn_put, so that
other CPUs see the refcnt operation after other writes.

With the introduction of ip_vs_conn_unlink()
we try to reorganize ip_vs_conn_expire(), so that
unhashing of connections that should stay more time is
avoided, even if it is for very short time.

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_conn.c