netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>, eric.dumazet@gmail.com
Cc: soheil.kdev@gmail.com, netdev@vger.kernel.org, ycheng@google.com,
	ncardwell@google.com, edumazet@google.com, willemb@google.com,
	soheil@google.com
Subject: Re: [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read
Date: Mon, 30 Apr 2018 09:01:47 -0700	[thread overview]
Message-ID: <c95883da-51ab-47aa-7ad1-a5bb85935e6b@gmail.com> (raw)
In-Reply-To: <20180430.115605.1094351453502803017.davem@davemloft.net>



On 04/30/2018 08:56 AM, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> 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 you allow overlapping changes to either of the two variables during
> the sampling, then you are reporting a number which was never true at
> any point in time.
> 
> It is essentially garbage.


Correct.

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" 

  reply	other threads:[~2018-04-30 16:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 18:57 [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read Soheil Hassas Yeganeh
2018-04-27 18:57 ` [PATCH V2 net-next 2/2] selftest: add test for TCP_INQ Soheil Hassas Yeganeh
2018-04-30 15:38 ` [PATCH V2 net-next 1/2] tcp: send in-queue bytes in cmsg upon read David Miller
2018-04-30 15:43   ` Eric Dumazet
2018-04-30 15:56     ` David Miller
2018-04-30 16:01       ` Eric Dumazet [this message]
2018-04-30 16:10         ` David Miller
2018-04-30 16:59           ` Soheil Hassas Yeganeh
2018-04-30 15:59     ` Soheil Hassas Yeganeh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c95883da-51ab-47aa-7ad1-a5bb85935e6b@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=soheil.kdev@gmail.com \
    --cc=soheil@google.com \
    --cc=willemb@google.com \
    --cc=ycheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).