public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ivan Novick <novickivan@gmail.com>
Cc: netdev@vger.kernel.org, Tim Heath <theath@greenplum.com>
Subject: Re: Choppy TCP send performance
Date: Sat, 29 May 2010 00:00:55 +0200	[thread overview]
Message-ID: <1275084055.2472.15.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTilZxoSEGOhmWdk2RbIGMmCMi2yNJm9rUwIzDIoL@mail.gmail.com>

Le vendredi 28 mai 2010 à 14:35 -0700, Ivan Novick a écrit :
> On Fri, May 28, 2010 at 2:16 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Le vendredi 28 mai 2010 à 13:38 -0700, Ivan Novick a écrit :
> >> sk_stream_wait_memory seems to be called when the send buffer is full
> >> and the next send call does not complete until the send buffer
> >> utilization goes down from 4,194,304 bytes to 2,814,968 bytes.
> >>
> >> This implies that the send that blocks on a full send buffer will not
> >> complete until there is 1 meg of free space in the send buffer even
> >> though the send could be accepted into the OS with only 128KB of free
> >> space.
> >>
> >
> > static void sock_def_write_space(struct sock *sk)
> > {
> > ...
> > if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
> > ...
> >
> >
> > Quick answer is : No, this is not tunable ( independantly than SNDBUF )
> >
> > SO_SNDLOWAT is not implemented on linux, yet (its value is : 1).
> >
> >
> > Why would you want to wakeup your thread more than necessary ?
> 
> Cool.  This helps me understand what is happening.
> 
> My user thread wants to wake up as soon as the OS can accept my data
> so that it can continue doing work and interact with other components
> in the system.  This is an application issue, i can work around it now
> that i have a better understanding of what the kernel is doing.

If you use poll() or select() before issuing your write(), I believe it
should be OK.




  reply	other threads:[~2010-05-28 22:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 20:38 Choppy TCP send performance Ivan Novick
2010-05-28 21:16 ` Eric Dumazet
2010-05-28 21:35   ` Ivan Novick
2010-05-28 22:00     ` Eric Dumazet [this message]
2010-05-28 22:23       ` Ivan Novick
2010-05-28 22:08     ` Rick Jones
2010-05-28 22:28       ` Ivan Novick
2010-05-28 22:57         ` Rick Jones

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=1275084055.2472.15.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=novickivan@gmail.com \
    --cc=theath@greenplum.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