]> git.baikalelectronics.ru Git - kernel.git/commit
net: don't reallocate skb->head unless the current one hasn't the needed extra size...
authorChangli Gao <xiaosuo@gmail.com>
Mon, 29 Nov 2010 22:48:46 +0000 (22:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Dec 2010 18:59:47 +0000 (10:59 -0800)
commitb5b11959c69440088fbba695abbc898d8348513e
treeab71f5c91ddc162ba4f570cbd5e47049a6c2e94e
parente6c100fc2102417fecb8e72b816a06f4b0d6f334
net: don't reallocate skb->head unless the current one hasn't the needed extra size or is shared

skb head being allocated by kmalloc(), it might be larger than what
actually requested because of discrete kmem caches sizes. Before
reallocating a new skb head, check if the current one has the needed
extra size.

Do this check only if skb head is not shared.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c