From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: rick.jones2@hp.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] tcp: reduce memory needs of out of order queue
Date: Sat, 15 Oct 2011 08:54:42 +0200 [thread overview]
Message-ID: <1318661682.2525.41.camel@edumazet-laptop> (raw)
In-Reply-To: <20111014.191845.232827637484150228.davem@davemloft.net>
Le vendredi 14 octobre 2011 à 19:18 -0400, David Miller a écrit :
> From: Rick Jones <rick.jones2@hp.com>
> Date: Fri, 14 Oct 2011 15:12:04 -0700
>
> > From just a very quick look it looks like tcp_v[46]_rcv is called,
> > finds that the socket is owned by the user, attempts to add to the
> > backlog, but the path called by sk_add_backlog does not seem to make
> > any attempts to compress things, so when the quantity of data is <<
> > the truesize it starts tossing babies out with the bathwater.
>
> This is why I don't believe the right fix is to add bandaids all
> around the TCP layer.
>
> The wastage has to be avoided at a higher level.
We cant do that at higher level without smart hardware (like NIU) or
adding a copy.
Its a tradeoff between space and speed.
Most drivers have to allocate a large skb1 and post it to hardware to
receive a frame (Unknown length, only max length is known)
Some drivers have a copybreak feature, doing a copy of small incoming
frames into a smaller skb2 (skb2->truesize < skb1->truesize)
This strategy do save memory for small frames, not for 1500 bytes
frames.
I think the problem is in TCP layer (and maybe in other protocols) :
1) Either tune rcvbuf to allow more memory to be used, for a particular
tcp window,
Or lower TCP window to allow less packets in flight for a given
rcvbuf.
2) TCP COLLAPSE already is trying to reduce memory costs of a tcp socket
with many packets in OFO queue. But fixing 1) would make these collapses
never happen in the first place. People wanting high TCP bandwidth
[ with say more than 500 in-flight packets per session ] can certainly
afford having enough memory.
next prev parent reply other threads:[~2011-10-15 6:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-14 7:19 [PATCH net-next] tcp: reduce memory needs of out of order queue Eric Dumazet
2011-10-14 7:42 ` David Miller
2011-10-14 8:05 ` Eric Dumazet
2011-10-14 17:33 ` Eric Dumazet
2011-10-14 15:50 ` Rick Jones
2011-10-14 16:00 ` Eric Dumazet
2011-10-14 16:11 ` Eric Dumazet
2011-10-14 22:12 ` Rick Jones
2011-10-14 23:18 ` David Miller
2011-10-15 6:54 ` Eric Dumazet [this message]
2011-10-17 0:53 ` David Miller
2011-10-17 7:02 ` Eric Dumazet
2011-10-15 6:39 ` Eric Dumazet
2011-10-17 16:47 ` 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=1318661682.2525.41.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.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