From: David Miller <davem@davemloft.net>
To: alexander.duyck@gmail.com
Cc: eric.dumazet@gmail.com, alexander.h.duyck@intel.com,
netdev@vger.kernel.org, edumazet@google.com,
jeffrey.t.kirsher@intel.com
Subject: Re: [PATCH 2/2] tcp: cleanup tcp_try_coalesce
Date: Thu, 03 May 2012 01:50:18 -0400 (EDT) [thread overview]
Message-ID: <20120503.015018.1396745597972676005.davem@davemloft.net> (raw)
In-Reply-To: <4FA21A90.3010008@gmail.com>
From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Wed, 02 May 2012 22:41:36 -0700
> I think the part that has me confused is how being more precise about
> removing from truesize gets in the way of detecting abuses of
> truesize. It seems like it should be more as good as or better then
> the original approach of just using skb->len.
You can only trim from truesize if you can be absolutely certain that
you have removed any reference in the fraglist, or the page'd head, to
the entire "block" of data.
If the skb still refers to even just one byte in a particular block,
we must still charge the entire block in the truesize.
For example, NIU has three pools of power-of-2 blocks of data it
maintainers and the device pulls from to build incoming packets.
So if the chip used one of the 2048 byte buffers, we charge the entire
2048 bytes even of the packet is much smaller.
Conversely this means we cannot trim the 2048 part of the truesize of
that SKB unless we had some mechanism to know for certain 1) what the
block size of the underlying data is and 2) that we've removed all
references to that.
Currently this is not really possible, so we therefore defer truesize
adjustments.
Behaving otherwise is dangerous, because then we'd potentially end up
with a lot of memory used, but not actually accounted for by anyone.
next prev parent reply other threads:[~2012-05-03 5:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 3:38 [PATCH 0/2] Cleanups for head_frag usage and tcp_try_coalese Alexander Duyck
2012-05-03 3:38 ` [PATCH 1/2] net: Stop decapitating clones that have a head_frag Alexander Duyck
2012-05-03 3:56 ` Eric Dumazet
2012-05-03 3:39 ` [PATCH 2/2] tcp: cleanup tcp_try_coalesce Alexander Duyck
2012-05-03 4:06 ` Eric Dumazet
2012-05-03 4:58 ` Alexander Duyck
2012-05-03 5:19 ` Eric Dumazet
2012-05-03 5:25 ` David Miller
[not found] ` <20120503.012502.44731688706812861.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-05-03 15:14 ` John W. Linville
2012-05-03 15:24 ` Guy, Wey-Yi
2012-05-03 17:07 ` John W. Linville
[not found] ` <20120503170727.GM9285-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2012-05-03 20:21 ` Guy, Wey-Yi
2012-05-03 5:41 ` Alexander Duyck
2012-05-03 5:50 ` David Miller [this message]
2012-05-03 7:08 ` Alexander Duyck
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=20120503.015018.1396745597972676005.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=jeffrey.t.kirsher@intel.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).