Subject: Re: [PATCH RFC] net: add alloc_skb_mustcopy() to make clone copy

From: David Miller <[email-masked]>
Date: Tue, 20 Oct 2009 00:52:47 -0700 (PDT)

From: Jeremy Fitzhardinge <[email-masked]>
Date: Tue, 20 Oct 2009 15:19:18 +0900

> When doing network IO on behalf of guests, a Xen dom0 kernel gets granted
> pages from guests.  These pages cannot be released normally, so we must
> handle releasing them specially, which can do with a skb_destructor.
> 
> This is complicated by the fact that the lifetime of an skb's
> frags can be extended via cloning.  To address this, this patch adds
> alloc_skb_mustcopy() which allocates an skb with fclone==SKB_MUST_COPY.
> If skb_clone() sees an skb with this set, it simply calls skb_copy
> instead so that there are no aliases to the granted pages.
> 
> /* Signed-off-by: Jeremy Fitzhardinge <[email-masked]> */

This looks perfectly fine to me.

Let me know if it actually works out for you and we can merge
this.