[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4cea30465ff621681090fff69d5ccc97f53e85a.camel@redhat.com>
Date: Wed, 15 Feb 2023 09:53:54 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, willemb@...gle.com,
fw@...len.de
Subject: Re: [RFC] net: skbuff: let struct skb_ext live inside the head
On Tue, 2023-02-14 at 19:44 -0800, Jakub Kicinski wrote:
> This is a bit more crazy than the previous patch. For drivers
> which already use build_skb() it's relatively easy to add more
> space to the shinfo. Use this approach to place skb_ext inside
> the head. No allocation needed.
>
> This approach is a bit slower in trivial benchmarks than the recycling
> because it requires extra cache line accesses (12.1% loss, ->18.6Gbps).
>
> In-place skb_ext may be shorter than a full skb_ext object.
> The driver only reserves space for exts it may use.
> Any later addition will reallocate the space via CoW,
> abandoning the in-place skb_ext and copying the data to
> a full slab object.
I personally like the other option (the non RFC series) more. It looks
like this requires a quite larger code churn that could be error-prone
and even non interested parties/callers/code-paths may end-up paying
some extra overhead/additional cycles.
Still, if you are willing to experiment more this idea, I think you
could save the extra cacheline miss encoding the 'alloc_mode' into the
lower bits of skb->extensions (alike what _skb_refdst is doing with the
SKB_DST_NOREF flag).
Cheers,
Paolo
Powered by blists - more mailing lists