Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread Soheil Hassas Yeganeh
On Mon, Apr 30, 2018 at 12:10 PM, David Miller wrote: > From: Eric Dumazet > Date: Mon, 30 Apr 2018 09:01:47 -0700 > >> TCP sockets are read by a single thread really (or synchronized >> threads), or garbage is ensured, regardless of how the kernel >>

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread David Miller
From: Eric Dumazet Date: Mon, 30 Apr 2018 09:01:47 -0700 > TCP sockets are read by a single thread really (or synchronized > threads), or garbage is ensured, regardless of how the kernel > ensures locking while reporting "queue length" Whatever applications "typically

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread Eric Dumazet
On 04/30/2018 08:56 AM, David Miller wrote: > From: Eric Dumazet > Date: Mon, 30 Apr 2018 08:43:50 -0700 > >> I say sort of, because by the time we have any number, TCP might >> have received more packets anyway. > > That's fine. > > However, the number reported

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread Soheil Hassas Yeganeh
On Mon, Apr 30, 2018 at 11:43 AM, Eric Dumazet wrote: > On 04/30/2018 08:38 AM, David Miller wrote: >> From: Soheil Hassas Yeganeh >> Date: Fri, 27 Apr 2018 14:57:32 -0400 >> >>> Since the socket lock is not held when calculating the size of >>>

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread David Miller
From: Eric Dumazet Date: Mon, 30 Apr 2018 08:43:50 -0700 > I say sort of, because by the time we have any number, TCP might > have received more packets anyway. That's fine. However, the number reported should have been true at least at some finite point in time. If

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread Eric Dumazet
On 04/30/2018 08:38 AM, David Miller wrote: > From: Soheil Hassas Yeganeh > Date: Fri, 27 Apr 2018 14:57:32 -0400 > >> Since the socket lock is not held when calculating the size of >> receive queue, TCP_INQ is a hint. For example, it can overestimate >> the queue size

Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-30 Thread David Miller
From: Soheil Hassas Yeganeh Date: Fri, 27 Apr 2018 14:57:32 -0400 > Since the socket lock is not held when calculating the size of > receive queue, TCP_INQ is a hint. For example, it can overestimate > the queue size by one byte, if FIN is received. I think it is even

[PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read

2018-04-27 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh Applications with many concurrent connections, high variance in receive queue length and tight memory bounds cannot allocate worst-case buffer size to drain sockets. Knowing the size of receive queue length, applications can optimize how they