From: Vlad Yasevich <[EMAIL PROTECTED]> Date: Mon, 02 Oct 2006 10:46:42 -0400
> David Miller wrote: > > If, on the other hand, you know you have exclusive access to the > > skb and there are no other references, setting skb->truesize can > > be OK. However setting it to sizeof(struct sk_buff) doesn't make > > sense since there is at least: > > > > sizeof(struct sk_buff) + sizeof(struct skb_shared_info) > > > > memory assosciated with any SKB whatsoever in the kernel. That is, > > even for a "zero length" skb->data buffer, we still always allocate > > the skb_shared_info area which must be accounted for. > > Well, since we are dealing with clones of the original skb, I didn't > think that we need to include skb_shared_info. I thought that was > accounted for in the original skb? We use the original packet's truesize, as-is, when making SKB clones. This is our global policy. The reason for that behavior is the usual case is that the clone is being attached to a different socket than the original SKB will. And we very much should charge the memory fully to every socket that references it. In your case it seems that the memory is already charged to the socket, and we would just be charging that memory again to the same socket. So in this very specific case, it should be OK not to include skb_shared_info in the truesize calculation. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html