From: "Maciej Żenczykowski" <maze@google.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
ilpo.jarvinen@helsinki.fi, rick.jones2@hp.com,
netdev@vger.kernel.org, therbert@google.com,
ncardwell@google.com, ycheng@google.com
Subject: Re: [RFC] allow skb->head to point/alias to first skb frag
Date: Thu, 26 Apr 2012 03:09:32 -0700 [thread overview]
Message-ID: <CANP3RGdnZk5b-gMkF8BPScrp9xos4X1u3n58ocuBQhTT7taE8A@mail.gmail.com> (raw)
In-Reply-To: <1335432147.2775.27.camel@edumazet-glaptop>
it would be very useful if there was an api for freeing skb->head memory...
I've fooled around with a single memory buffer for both the head and
the data and seen huge performance wins under heavy packet load (half
the amount of malloc/free), but could never quite get it to be 100%
stable.
On Thu, Apr 26, 2012 at 2:22 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2012-04-26 at 05:18 -0400, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Thu, 26 Apr 2012 11:10:02 +0200
>>
>> > The 'frag' would have a known size : 2048 bytes
>> >
>> > But the end of it would be used by struct skb_shared_info
>> >
>> > so data_len would be 0 in fact.
>> >
>> > This would look like a regular linear skb.
>> >
>> > Just a bit set in skb to say : Warning, skb->head was not kmalloced :
>> > replace kfree(head) by put_page(...)
>> >
>> > And this bit would be tested in GRO or tcp merge to 'upgrade' this
>> > skb->head to proper page/frag
>>
>> And what happens if this ends up in a piece of code which wants to
>> append a page frag?
>>
>> Or a piece of code which copies an SKB, including page frag parts?
>>
>> All I'm saying is that the number of tests necessary to make this work
>> properly might become prohibitive.
>
> I'll cook a patch, I believe not so many parts assume skb->head can be
> kmalloc()/kfree(). This should be contained in net/core/skbuff.c only.
>
> Elsewhere we use skb->head as a pointer to memory. It will stay the
> same.
>
>
>
--
Maciej A. Żenczykowski
Kernel Networking Developer @ Google
1600 Amphitheatre Parkway, Mountain View, CA 94043
tel: +1 (650) 253-0062
next prev parent reply other threads:[~2012-04-26 10:09 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 9:38 [PATCH 2/2 net-next] tcp: sk_add_backlog() is too agressive for TCP Eric Dumazet
2012-04-23 17:14 ` Rick Jones
2012-04-23 17:23 ` Eric Dumazet
2012-04-23 20:01 ` David Miller
2012-04-23 20:37 ` Eric Dumazet
2012-04-23 20:57 ` Rick Jones
2012-04-23 21:30 ` Eric Dumazet
2012-04-23 21:51 ` Rick Jones
2012-04-23 21:56 ` Rick Jones
2012-04-23 22:05 ` Eric Dumazet
2012-04-23 22:16 ` Rick Jones
2012-04-24 15:25 ` Christoph Lameter
2012-04-23 21:01 ` David Miller
2012-04-23 21:38 ` Eric Dumazet
2012-04-24 2:20 ` Eric Dumazet
2012-04-24 2:27 ` David Miller
2012-04-24 8:01 ` Ilpo Järvinen
2012-04-24 8:10 ` David Miller
2012-04-24 8:21 ` Ilpo Järvinen
2012-04-24 8:25 ` David Miller
2012-04-24 8:40 ` Ilpo Järvinen
2012-04-24 8:48 ` David Miller
2012-04-24 10:32 ` Ilpo Järvinen
2012-04-24 8:56 ` Eric Dumazet
2012-04-26 8:10 ` [RFC] allow skb->head to point/alias to first skb frag Eric Dumazet
2012-04-26 8:36 ` David Miller
2012-04-26 9:10 ` Eric Dumazet
2012-04-26 9:18 ` David Miller
2012-04-26 9:22 ` Eric Dumazet
2012-04-26 10:09 ` Maciej Żenczykowski [this message]
2012-04-26 12:32 ` Eric Dumazet
2012-04-26 13:50 ` Eric Dumazet
2012-04-26 20:12 ` David Miller
2012-04-26 20:18 ` Eric Dumazet
2012-04-24 8:49 ` [PATCH 2/2 net-next] tcp: sk_add_backlog() is too agressive for TCP Eric Dumazet
2012-04-24 8:44 ` David Laight
2012-04-24 8:53 ` Eric Dumazet
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=CANP3RGdnZk5b-gMkF8BPScrp9xos4X1u3n58ocuBQhTT7taE8A@mail.gmail.com \
--to=maze@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=ilpo.jarvinen@helsinki.fi \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
--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;
as well as URLs for NNTP newsgroup(s).