Eric Dumazet 87fb4b7b53 net: more accurate skb truesize
skb truesize currently accounts for sk_buff struct and part of skb head.
kmalloc() roundings are also ignored.

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.

At skb alloc phase, we put skb_shared_info struct at the exact end of
skb head, to allow a better use of memory (lowering number of
reallocations), since kmalloc() gives us power-of-two memory blocks.

Unless SLUB/SLUB debug is active, both skb->head and skb_shared_info are
aligned to cache lines, as before.

Note: This patch might trigger performance regressions because of
misconfigured protocol stacks, hitting per socket or global memory
limits that were previously not reached. But its a necessary step for a
more accurate memory accounting.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Andi Kleen <ak@linux.intel.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-13 16:05:07 -04:00
..
2011-04-17 00:48:31 -07:00
2011-10-13 16:05:07 -04:00
2011-03-17 11:59:32 +11:00
2011-09-15 15:36:35 -04:00
2011-10-13 16:05:07 -04:00
2011-10-13 16:05:07 -04:00
2011-03-21 18:16:39 -07:00
2011-10-13 16:05:07 -04:00
2011-06-16 23:19:27 -04:00
2011-09-16 19:20:20 -04:00
2011-07-01 16:11:16 -07:00
2011-09-27 14:34:10 -04:00
2011-10-13 16:05:07 -04:00
2011-03-31 11:26:23 -03:00
2011-07-01 16:11:16 -07:00
2011-05-05 11:10:14 -07:00
2011-07-05 15:26:57 -04:00
2011-07-05 15:26:57 -04:00
2010-10-15 15:53:27 +02:00