[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK6E8=d1CxqkYy+Ad9Vw4NpP_6UKir5Rik=EuN=zGD8o-4USWQ@mail.gmail.com>
Date: Wed, 21 Nov 2018 14:40:06 -0800
From: Yuchung Cheng <ycheng@...gle.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Jean-Louis Dupond <jean-louis@...ond.be>,
Neal Cardwell <ncardwell@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue
On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet <edumazet@...gle.com> wrote:
> Under high stress, and if GRO or coalescing does not help,
> we better make room in backlog queue to be able to keep latest
> packet coming.
>
> This generally helps fast recovery, given that we often receive
> packets in order.
I like the benefit of fast recovery but I am a bit leery about head
drop causing HoLB on large read, while tail drops can be repaired by
RACK and TLP already. Hmm -
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Tested-by: Jean-Louis Dupond <jean-louis@...ond.be>
> Cc: Neal Cardwell <ncardwell@...gle.com>
> Cc: Yuchung Cheng <ycheng@...gle.com>
> ---
> net/ipv4/tcp_ipv4.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 401e1d1cb904a4c7963d8baa419cfbf178593344..36c9d715bf2aa7eb7bf58b045bfeb85a2ec1a696 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1693,6 +1693,20 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
> __skb_push(skb, hdrlen);
> }
>
> + while (sk_rcvqueues_full(sk, limit)) {
> + struct sk_buff *head;
> +
> + head = sk->sk_backlog.head;
> + if (!head)
> + break;
> + sk->sk_backlog.head = head->next;
> + if (!head->next)
> + sk->sk_backlog.tail = NULL;
> + skb_mark_not_on_list(head);
> + sk->sk_backlog.len -= head->truesize;
> + kfree_skb(head);
> + __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPBACKLOGDROP);
> + }
> /* Only socket owner can try to collapse/prune rx queues
> * to reduce memory overhead, so add a little headroom here.
> * Few sockets backlog are possibly concurrently non empty.
> --
> 2.19.1.1215.g8438c0b245-goog
>
Powered by blists - more mailing lists