diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-11-25 21:17:14 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 21:17:14 -0800 |
commit | dd24c00191d5e4a1ae896aafe33c6b8095ab4bd1 (patch) | |
tree | e955c09e0b288e50c706b6ee409229d5a930c80c /net/ipv4/tcp_timer.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/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3df339e3e36..cc4e6d27ded 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -65,7 +65,7 @@ static void tcp_write_err(struct sock *sk) static int tcp_out_of_resources(struct sock *sk, int do_reset) { struct tcp_sock *tp = tcp_sk(sk); - int orphans = atomic_read(&tcp_orphan_count); + int orphans = percpu_counter_read_positive(&tcp_orphan_count); /* If peer does not open window for long time, or did not transmit * anything for long time, penalize it. */ |