Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-12 Thread Eric Dumazet
On Tue, 2016-04-12 at 20:31 +0800, Yang Yingliang wrote: > I traced the cost cycles of handling backlog packets in > __release_sock(). > 16.97 ms to handling about 12MB backlog packets, of which 13.66ms to do > sk_data_ready. > The speed of handling packets in TCP is 5.65Gb/s which is smaller

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-12 Thread Yang Yingliang
On 2016/4/12 10:59, Yang Yingliang wrote: On 2016/4/11 20:13, Eric Dumazet wrote: On Mon, 2016-04-11 at 19:57 +0800, Yang Yingliang wrote: On 2016/4/8 22:44, Eric Dumazet wrote: On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: I expand tcp_adv_win_scale and tcp_rmem. It has no

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-11 Thread Yang Yingliang
On 2016/4/11 20:13, Eric Dumazet wrote: On Mon, 2016-04-11 at 19:57 +0800, Yang Yingliang wrote: On 2016/4/8 22:44, Eric Dumazet wrote: On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: I expand tcp_adv_win_scale and tcp_rmem. It has no effect. Try : echo -2

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-11 Thread Yang Yingliang
On 2016/4/9 1:04, Eric Dumazet wrote: On Fri, 2016-04-08 at 12:53 -0400, David Miller wrote: From: Eric Dumazet Date: Fri, 08 Apr 2016 07:44:25 -0700 On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: I expand tcp_adv_win_scale and tcp_rmem. It has no

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-11 Thread Eric Dumazet
On Mon, 2016-04-11 at 19:57 +0800, Yang Yingliang wrote: > > On 2016/4/8 22:44, Eric Dumazet wrote: > > On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: > > > >> I expand tcp_adv_win_scale and tcp_rmem. It has no effect. > > > > Try : > > > > echo -2 >/proc/sys/net/ipv4/tcp_adv_win_scale

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-11 Thread Yang Yingliang
On 2016/4/8 22:44, Eric Dumazet wrote: On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: I expand tcp_adv_win_scale and tcp_rmem. It has no effect. Try : echo -2 >/proc/sys/net/ipv4/tcp_adv_win_scale And restart your flows. cat /proc/sys/net/ipv4/tcp_rmem 10240 2097152 10485760

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-08 Thread Eric Dumazet
On Fri, 2016-04-08 at 12:53 -0400, David Miller wrote: > From: Eric Dumazet > Date: Fri, 08 Apr 2016 07:44:25 -0700 > > > On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: > > > >> I expand tcp_adv_win_scale and tcp_rmem. It has no effect. > > > > Try : > > > >

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-08 Thread David Miller
From: Eric Dumazet Date: Fri, 08 Apr 2016 07:44:25 -0700 > On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: > >> I expand tcp_adv_win_scale and tcp_rmem. It has no effect. > > Try : > > echo -2 >/proc/sys/net/ipv4/tcp_adv_win_scale > > And restart your flows.

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-08 Thread Eric Dumazet
On Fri, 2016-04-08 at 19:18 +0800, Yang Yingliang wrote: > I expand tcp_adv_win_scale and tcp_rmem. It has no effect. Try : echo -2 >/proc/sys/net/ipv4/tcp_adv_win_scale And restart your flows.

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-08 Thread Yang Yingliang
On 2016/4/7 22:51, Eric Dumazet wrote: On Thu, 2016-04-07 at 03:21 -0700, Eric Dumazet wrote: Please do not send patches before really understanding the issue you have. Having a backlog of 12506206 bytes is ridiculous. Dropping packets is absolutely fine if this ever happens. Something is

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-07 Thread Eric Dumazet
On Thu, 2016-04-07 at 03:21 -0700, Eric Dumazet wrote: > Please do not send patches before really understanding the issue you > have. > > Having a backlog of 12506206 bytes is ridiculous. Dropping packets is > absolutely fine if this ever happens. > > Something is really wrong on your host, or

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-07 Thread Eric Dumazet
On Thu, 2016-04-07 at 13:59 +0800, Yang Yingliang wrote: > > On 2016/3/30 21:47, Eric Dumazet wrote: > > On Wed, 2016-03-30 at 13:56 +0800, Yang Yingliang wrote: > > > >> Sorry, I made a mistake. I am very sure my kernel has these two patches. > >> And I can get some dropping of the packets in

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-07 Thread Yang Yingliang
On 2016/3/30 21:47, Eric Dumazet wrote: On Wed, 2016-03-30 at 13:56 +0800, Yang Yingliang wrote: Sorry, I made a mistake. I am very sure my kernel has these two patches. And I can get some dropping of the packets in 10Gb eth. # netstat -s | grep -i backlog TCPBacklogDrop: 4135 #

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-04-07 Thread Yang Yingliang
On 2016/3/30 20:56, Sergei Shtylyov wrote: Hello. On 3/30/2016 8:16 AM, Yang Yingliang wrote: When task A hold the sk owned in tcp_sendmsg, if lots of packets arrive and the packets will be added to backlog queue. The packets will be handled in release_sock called from tcp_sendmsg. When the

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-30 Thread Eric Dumazet
On Wed, 2016-03-30 at 13:56 +0800, Yang Yingliang wrote: > Sorry, I made a mistake. I am very sure my kernel has these two patches. > And I can get some dropping of the packets in 10Gb eth. > > # netstat -s | grep -i backlog > TCPBacklogDrop: 4135 > # netstat -s | grep -i backlog >

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-30 Thread Sergei Shtylyov
Hello. On 3/30/2016 8:16 AM, Yang Yingliang wrote: When task A hold the sk owned in tcp_sendmsg, if lots of packets arrive and the packets will be added to backlog queue. The packets will be handled in release_sock called from tcp_sendmsg. When the sk_backlog is removed from sk, the length

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-29 Thread Yang Yingliang
On 2016/3/30 13:34, Eric Dumazet wrote: On Tue, 2016-03-29 at 22:25 -0700, Eric Dumazet wrote: On Wed, 2016-03-30 at 13:16 +0800, Yang Yingliang wrote: When task A hold the sk owned in tcp_sendmsg, if lots of packets arrive and the packets will be added to backlog queue. The packets will be

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-29 Thread Yang Yingliang
On 2016/3/30 13:25, Eric Dumazet wrote: On Wed, 2016-03-30 at 13:16 +0800, Yang Yingliang wrote: When task A hold the sk owned in tcp_sendmsg, if lots of packets arrive and the packets will be added to backlog queue. The packets will be handled in release_sock called from tcp_sendmsg. When

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-29 Thread Eric Dumazet
On Tue, 2016-03-29 at 22:25 -0700, Eric Dumazet wrote: > On Wed, 2016-03-30 at 13:16 +0800, Yang Yingliang wrote: > > When task A hold the sk owned in tcp_sendmsg, if lots of packets > > arrive and the packets will be added to backlog queue. The packets > > will be handled in release_sock called

Re: [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-29 Thread Eric Dumazet
On Wed, 2016-03-30 at 13:16 +0800, Yang Yingliang wrote: > When task A hold the sk owned in tcp_sendmsg, if lots of packets > arrive and the packets will be added to backlog queue. The packets > will be handled in release_sock called from tcp_sendmsg. When the > sk_backlog is removed from sk, the

[PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk

2016-03-29 Thread Yang Yingliang
When task A hold the sk owned in tcp_sendmsg, if lots of packets arrive and the packets will be added to backlog queue. The packets will be handled in release_sock called from tcp_sendmsg. When the sk_backlog is removed from sk, the length will not decrease until all the packets in backlog queue