[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1318539115.2533.12.camel@edumazet-laptop>
Date: Thu, 13 Oct 2011 22:51:55 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: more accurate skb truesize
Le jeudi 13 octobre 2011 à 13:33 -0700, Andi Kleen a écrit :
> On Thu, Oct 13, 2011 at 05:26:21PM +0200, Eric Dumazet wrote:
> > skb truesize currently accounts for sk_buff struct and part of skb head.
> >
> > Considering that skb_shared_info is larger than sk_buff, its time to
> > take it into account for better memory accounting.
> >
> > This patch introduces SKB_TRUESIZE(X) macro to centralize various
> > assumptions into a single place.
>
> It's still quite inaccurate, especially for the kmalloced data area if it's not
> paged. It would be better to ask slab how much memory was really
> allocated. But at least this could be done more easily now with the new
> macro, so it's definitely a step in the right direction.
Note : in skb_alloc() function, SKB_TRUESIZE(size) delivers the exact
value : I do the ksize(data) call to ask how many byte kmalloc()
provided me.
So skb->truesize is quite accurate (unless KMEMCHECK or other debug
stuff is used of course)
For the SKB_TRUESIZE() macro, we dont want to do a dummy call to
kmalloc()/kfree(), since its basically used to roughly set a queue
limit.
Thanks !
--
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