netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chris Friesen" <cfriesen@nortel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: seeing strange values for tcp sk_rmem_alloc
Date: Thu, 03 Dec 2009 15:40:41 -0600	[thread overview]
Message-ID: <4B183059.4070109@nortel.com> (raw)
In-Reply-To: <4B17EF8E.60704@gmail.com>

On 12/03/2009 11:04 AM, Eric Dumazet wrote:
> Chris Friesen a écrit :

>> Ah, that makes a difference.  But the results (see below) still
>> look odd.  For this test, /proc/sys/net/core/rmem_default is
>> 118784.  For some reason sk_rmem_alloc gets bumped by 16KB when I
>> only send 2KB of data, and it drops back down again every 6
>> packets.

> 
> Might be because you use loopback device ? ;)
> 
> ifconfig lo | grep MTU UP LOOPBACK RUNNING  MTU:16436  Metric:1
> 
> After a while (when hitting rcvbuf limit), tcp stack performs skb
> collapses, to reduce ram usage.

Looks like this is indeed the case, changing the loopback mtu to 8K
makes it increase in 8K increments.  This is quite unexpected, since for
UDP it only increases by the actual amount of the data being sent rather
than the size of the full MTU.

As it stands, it looks like sk_rmem_alloc isn't very useful.  Can you
point me to something that is more reflective of the actual space used
by the tcp socket?  I'd like something that increases monotonically with
received data and once it exceeds the configured size then the tcp stack
will start dropping packets.  Does such a thing exist, or is the tcp
stack just too complicated to easily obtain this sort of information?

Thanks for your help,

Chris

      reply	other threads:[~2009-12-03 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 16:16 seeing strange values for tcp sk_rmem_alloc Chris Friesen
2009-12-01 16:18 ` Chris Friesen
2009-12-01 16:58 ` Eric Dumazet
2009-12-01 17:28   ` Chris Friesen
2009-12-01 17:52     ` Eric Dumazet
2009-12-03 16:55       ` Chris Friesen
2009-12-03 17:04         ` Eric Dumazet
2009-12-03 21:40           ` Chris Friesen [this message]

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=4B183059.4070109@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).