[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1318523564.2745.32.camel@bwh-desktop>
Date: Thu, 13 Oct 2011 17:32:44 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH net-next] net: more accurate skb truesize
On Thu, 2011-10-13 at 18:24 +0200, Eric Dumazet wrote:
> Le jeudi 13 octobre 2011 à 17:05 +0100, Ben Hutchings a écrit :
[...]
> > If that's not important, and we just want to be sure that the allocation
> > occupies at least a whole cache line, then it should be:
> > size = SKB_DATA_ALIGN(size + sizeof(struct skb_shared_info));
> >
> > But I don't think it makes sense to use SKB_DATA_ALIGN(sizeof(struct
> > skb_shared_info)).
>
> If you take a closer look, you'll see that my patch addresses your
> concerns, but at minimal cpu cost.
>
> kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
>
> will give same result than :
>
> kmalloc(SKB_DATA_ALIGN(size) + SKB_DATA_ALIGN(sizeof(struct
> skb_shared_info)))
>
> But my version is a bit faster (a single add of a compiler known
> constant)
Fair enough, but please add a comment explaining this.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists