diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-11-26 00:17:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-26 00:17:14 -0500 |
commit | dd24c00191d5e4a1ae896aafe33c6b8095ab4bd1 (patch) | |
tree | e955c09e0b288e50c706b6ee409229d5a930c80c /net/ipv4/inet_connection_sock.c | |
parent | 1748376b6626acf59c24e9592ac67b3fe2a0e026 (diff) |
net: Use a percpu_counter for orphan_count
Instead of using one atomic_t per protocol, use a percpu_counter
for "orphan_count", to reduce cache line contention on
heavy duty network servers.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 05af807ca9b9..1ccdbba528be 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -561,7 +561,7 @@ void inet_csk_destroy_sock(struct sock *sk) | |||
561 | 561 | ||
562 | sk_refcnt_debug_release(sk); | 562 | sk_refcnt_debug_release(sk); |
563 | 563 | ||
564 | atomic_dec(sk->sk_prot->orphan_count); | 564 | percpu_counter_dec(sk->sk_prot->orphan_count); |
565 | sock_put(sk); | 565 | sock_put(sk); |
566 | } | 566 | } |
567 | 567 | ||
@@ -641,7 +641,7 @@ void inet_csk_listen_stop(struct sock *sk) | |||
641 | 641 | ||
642 | sock_orphan(child); | 642 | sock_orphan(child); |
643 | 643 | ||
644 | atomic_inc(sk->sk_prot->orphan_count); | 644 | percpu_counter_inc(sk->sk_prot->orphan_count); |
645 | 645 | ||
646 | inet_csk_destroy_sock(child); | 646 | inet_csk_destroy_sock(child); |
647 | 647 | ||