netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: gallatin@myri.com, mason@myri.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] myri10ge: fix truesize underestimation
Date: Thu, 20 Oct 2011 17:03:26 -0400 (EDT)	[thread overview]
Message-ID: <20111020.170326.2193877307745965380.davem@davemloft.net> (raw)
In-Reply-To: <1319144356.2854.36.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Oct 2011 22:59:16 +0200

> Le jeudi 20 octobre 2011 à 16:45 -0400, Andrew Gallatin a écrit :
>> On 10/20/11 16:44, Eric Dumazet wrote:
>> > Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
>> >> On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet<eric.dumazet@gmail.com>  wrote:
>> >>> skb->truesize must account for allocated memory, not the used part of
>> >>> it. Doing this work is important to avoid unexpected OOM situations.
>> >>>
>> >>> Signed-off-by: Eric Dumazet<eric.dumazet@gmail.com>
>> >>
>> >> Acked-by: Jon Mason<mason@myri.com>
>> >
>> > Thanks for reviewing Jon !
>> >
>> >
>> 
>> Please wait a second..  I think the patch is incorrect.
>> 
>> There is already code in myri10ge_rx_skb_build() which
>> attempts to set the truesize.  However, it sets it to
>> the used, rather than the allocated size so it is apparently
>> incorrect.
>> 
>> I'd prefer we fix that code.
> 
> Well, I believe I did exactly that :)
> 
> truesize of initial skb is fine.
> 
> Then for everay frag added, you must add to skb-truesize the allocated
> memory for this frag.
> 
> You add frags of a given size (small or big)
> 
> In the end, its truesize += bytes * number_of_frags
> 
> (bytes being small_size or big_size)

Right, I believe Eric's patch is correct, and I intend to apply it.

  reply	other threads:[~2011-10-20 21:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 20:10 [PATCH net-next] myri10ge: fix truesize underestimation Eric Dumazet
2011-10-20 20:33 ` Jon Mason
2011-10-20 20:44   ` Eric Dumazet
2011-10-20 20:45     ` Andrew Gallatin
2011-10-20 20:59       ` Eric Dumazet
2011-10-20 21:03         ` David Miller [this message]
2011-10-20 21:04         ` Andrew Gallatin
2011-10-20 21:06           ` Eric Dumazet
2011-10-20 21:42 ` 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=20111020.170326.2193877307745965380.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=gallatin@myri.com \
    --cc=mason@myri.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;
as well as URLs for NNTP newsgroup(s).