mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 06:52:07 +00:00
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>
This commit is contained in:
parent
1748376b66
commit
dd24c00191
8 changed files with 24 additions and 18 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue