netdev
[Top] [All Lists]

Re: Set truesize in pskb_expand_head

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: Set truesize in pskb_expand_head
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Fri, 24 Sep 2004 16:33:28 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040924232053.GA7807@xxxxxxxxxxxxxxxxxxx>
References: <20040924232053.GA7807@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Sat, 25 Sep 2004 09:20:53 +1000
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> In order for the skb trimming to work, we need to set truesize in
> pskb_expand_head.  This patch does exactly that.

I tried to warn people about this earlier in the netlink
NLMSG_GOODSIZE thread.... ho hum.

This change mucks up socket buffer accounting.

If you change skb->truesize, then when the kfree_skb(skb)
happens a different skb->truesize will be subtracted from
the socket buffer allocation than what was used when the
skb was first charged to the socket.

Basically, once a skb might potentially be charged to a
socket, you cannot change truesize unless you are extremely
careful.

This is another reason why I recommended to use a scratch
buffer, btw :-)

<Prev in Thread] Current Thread [Next in Thread>