Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, ncardwell@google.com,
	therbert@google.com, ycheng@google.com, ak@linux.intel.com
Subject: Re: [PATCH] tcp: avoid wakeups for pure ACK
Date: Wed, 27 Feb 2013 10:17:39 -0800	[thread overview]
Message-ID: <1361989059.11403.50.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130227.130444.2188252064827683663.davem@davemloft.net>

On Wed, 2013-02-27 at 13:04 -0500, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 27 Feb 2013 09:05:03 -0800
> 
> > Processing pure ACK on behalf of the thread blocked in tcp_recvmsg()
> > is a waste of resources, as thread has to immediately sleep again
> > because it got no payload.
> 
> More than one thread can be operating on the socket, the other one
> could be waiting for the window to open up in order to do a send.  Are
> you absolutely sure that we won't have a problem in that situation?


Yes, more than one thread can be operating, but the prequeue wakeups the
one blocked in tcp_recvmsg() only, because of :

wake_up_interruptible_sync_poll(sk_sleep(sk),
				POLLIN | POLLRDNORM | POLLRDBAND);


Then the ACK processing might/should wakeup the other thread blocked in
tcp_sendmsg().

So this patch will also help this (not very usual) situation, as we will
only wakeup the tcp_sendmsg() thread when ACK is processed from softirq
handler, and let the thread blocked in tcp_recvmsg() sleeping.


> In fact I wonder if that does the right thing right now.

Right now it is working, because at least one thread will process the
prequeue at the exit of tcp_recvmsg()

  reply	other threads:[~2013-02-27 18:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 17:05 [PATCH] tcp: avoid wakeups for pure ACK Eric Dumazet
2013-02-27 18:04 ` David Miller
2013-02-27 18:17   ` Eric Dumazet [this message]
2013-02-27 21:15     ` David Miller
2013-02-28 20:38 ` David Miller

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=1361989059.11403.50.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@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