summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_conntrack_core.c
diff options
context:
space:
mode:
authorPatrick McHardy2009-06-10 14:32:47 +0200
committerPatrick McHardy2009-06-10 14:32:47 +0200
commit440f0d588555892601cfe511728a0fc0c8204063 (patch)
tree1b98fe9ec8f7e7337f7eed09af2c36a43a9f92b8 /net/netfilter/nf_conntrack_core.c
parentnetfilter: xt_socket: added new revision of the 'socket' match supporting flags (diff)
downloadkernel-qcow2-linux-440f0d588555892601cfe511728a0fc0c8204063.tar.gz
kernel-qcow2-linux-440f0d588555892601cfe511728a0fc0c8204063.tar.xz
kernel-qcow2-linux-440f0d588555892601cfe511728a0fc0c8204063.zip
netfilter: nf_conntrack: use per-conntrack locks for protocol data
Introduce per-conntrack locks and use them instead of the global protocol locks to avoid contention. Especially tcp_lock shows up very high in profiles on larger machines. This will also allow to simplify the upcoming reliable event delivery patches. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_core.c')
-rw-r--r--net/netfilter/nf_conntrack_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index b54c23475e94..edf95695e0aa 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -519,6 +519,7 @@ struct nf_conn *nf_conntrack_alloc(struct net *net,
return ERR_PTR(-ENOMEM);
}
+ spin_lock_init(&ct->lock);
atomic_set(&ct->ct_general.use, 1);
ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig;
ct->tuplehash[IP_CT_DIR_REPLY].tuple = *repl;