linux-stable-rt/net
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
..
9p
802
8021q
appletalk
atm
ax25
batman-adv Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
bluetooth Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem 2011-10-11 15:35:42 -04:00
bridge Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
caif
can Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
ceph
core net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
dcb dcb: add DCBX mode to event notifier attributes 2011-10-06 15:49:51 -04:00
dccp
decnet
dns_resolver
dsa
econet
ethernet
ieee802154
ipv4 net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
ipv6 net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
ipx
irda
iucv net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
key
l2tp
lapb
llc
mac80211 Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem 2011-10-11 15:35:42 -04:00
netfilter Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
netlabel
netlink
netrom
nfc
packet af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb 2011-10-10 14:09:08 -04:00
phonet
rds Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
rfkill
rose
rxrpc
sched
sctp net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
sunrpc
tipc
unix
wanrouter
wimax
wireless
x25
xfrm Merge branch 'master' of github.com:davem330/net 2011-10-07 13:38:43 -04:00
Kconfig
Makefile
compat.c
nonet.c
socket.c
sysctl_net.c