aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-11-20 03:40:07 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 03:40:07 -0500
commit5caea4ea7088e80ac5410d04660346094608b909 (patch)
treefad95133683c002d24ff5de7fb756dad806b41ed /net/dccp/proto.c
parentd8b83c57a7e497cba9b5cb156e63176323035785 (diff)
net: listening_hash get a spinlock per bucket
This patch prepares RCU migration of listening_hash table for TCP/DCCP protocols. listening_hash table being small (32 slots per protocol), we add a spinlock for each slot, instead of a single rwlock for whole table. This should reduce hold time of readers, and writers concurrency. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r--net/dccp/proto.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index bdf784c422b5..8b63394ec24c 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -44,12 +44,7 @@ atomic_t dccp_orphan_count = ATOMIC_INIT(0);
44 44
45EXPORT_SYMBOL_GPL(dccp_orphan_count); 45EXPORT_SYMBOL_GPL(dccp_orphan_count);
46 46
47struct inet_hashinfo __cacheline_aligned dccp_hashinfo = { 47struct inet_hashinfo dccp_hashinfo;
48 .lhash_lock = RW_LOCK_UNLOCKED,
49 .lhash_users = ATOMIC_INIT(0),
50 .lhash_wait = __WAIT_QUEUE_HEAD_INITIALIZER(dccp_hashinfo.lhash_wait),
51};
52
53EXPORT_SYMBOL_GPL(dccp_hashinfo); 48EXPORT_SYMBOL_GPL(dccp_hashinfo);
54 49
55/* the maximum queue length for tx in packets. 0 is no limit */ 50/* the maximum queue length for tx in packets. 0 is no limit */
@@ -1030,6 +1025,7 @@ static int __init dccp_init(void)
1030 BUILD_BUG_ON(sizeof(struct dccp_skb_cb) > 1025 BUILD_BUG_ON(sizeof(struct dccp_skb_cb) >
1031 FIELD_SIZEOF(struct sk_buff, cb)); 1026 FIELD_SIZEOF(struct sk_buff, cb));
1032 1027
1028 inet_hashinfo_init(&dccp_hashinfo);
1033 dccp_hashinfo.bind_bucket_cachep = 1029 dccp_hashinfo.bind_bucket_cachep =
1034 kmem_cache_create("dccp_bind_bucket", 1030 kmem_cache_create("dccp_bind_bucket",
1035 sizeof(struct inet_bind_bucket), 0, 1031 sizeof(struct inet_bind_bucket), 0,