public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 0/6] net: make TCP preemptible
Date: Thu, 28 Apr 2016 10:51:56 -0700	[thread overview]
Message-ID: <20160428175154.GA83737@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <1461865270.5535.109.camel@edumazet-glaptop3.roam.corp.google.com>

On Thu, Apr 28, 2016 at 10:41:10AM -0700, Eric Dumazet wrote:
> On Thu, 2016-04-28 at 10:23 -0700, Alexei Starovoitov wrote:
> > On Wed, Apr 27, 2016 at 10:25:46PM -0700, Eric Dumazet wrote:
> > > Most of TCP stack assumed it was running from BH handler.
> > > 
> > > This is great for most things, as TCP behavior is very sensitive
> > > to scheduling artifacts.
> > > 
> > > However, the prequeue and backlog processing are problematic,
> > > as they need to be flushed with BH being blocked.
> > > 
> > > To cope with modern needs, TCP sockets have big sk_rcvbuf values,
> > > in the order of 16 MB.
> > > This means that backlog can hold thousands of packets, and things
> > > like TCP coalescing or collapsing on this amount of packets can
> > > lead to insane latency spikes, since BH are blocked for too long.
> > > 
> > > It is time to make UDP/TCP stacks preemptible.
> > > 
> > > Note that fast path still runs from BH handler.
> > 
> > this looks pretty awesome.
> 
> Yes, I am pretty excited ;)
> 
> > the change will make the backlog run in bh enabled, so that one
> > large flow reciever will not penalize the rest of the system, right?
> 
> Not only large flows, but flows with losses/reorders.
> Typically many flows are in this case when a congestion collapse
> happens.
> 
> 
> 
> > but you're saying that prequeue is also expensive, but not touched
> > by this patchset? was it addressed by your eariler patch?
> > Or more work still tbd?
> 
> prequeue is handled by "[2/6] tcp: do not block bh during prequeue
> processing"

got it. It applies to both v4 and v6, right?

> Note that I also sent a patch earlier (("tcp: give prequeue mode some
> care")) to control max size of prequeue to 32 packets.
> 
> > I'm just trying to understand more about tcp stack.
> > 
> Sure ;)
> 
> I also have a patch to add scheduling point in sendmsg() (ie : draining
> the backlog if not empty) for each new skb added to the write queue.
> 
> Since each skb is about 64KB (with GSO/TSO), it means an application no
> longer will hold the socket lock too long, even when doing a
> write()/sendmsg() of say 8 MB at once ;)

that would be awesome. I think map/reduce type jobs typically
do large sendmsg, so it should help p99 latency.

  reply	other threads:[~2016-04-28 17:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28  5:25 [PATCH net-next 0/6] net: make TCP preemptible Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 1/6] tcp: do not assume TCP code is non preemptible Eric Dumazet
2016-04-29  1:08   ` Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 2/6] tcp: do not block bh during prequeue processing Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 3/6] dccp: do not assume DCCP code is non preemptible Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 4/6] udp: prepare for non BH masking at backlog processing Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 5/6] sctp: prepare for socket backlog behavior change Eric Dumazet
2016-04-28  5:25 ` [PATCH net-next 6/6] net: do not block BH while processing socket backlog Eric Dumazet
2016-04-28 17:23 ` [PATCH net-next 0/6] net: make TCP preemptible Alexei Starovoitov
2016-04-28 17:41   ` Eric Dumazet
2016-04-28 17:51     ` Alexei Starovoitov [this message]
2016-04-28 18:04       ` Eric Dumazet
2016-04-28 21:18 ` Marcelo Ricardo Leitner

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=20160428175154.GA83737@ast-mbp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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