Re: [PATCH net 0/9] rxrpc: Fix use of skb_cow_data()

From: David Howells
Date: Fri Aug 23 2019 - 04:52:32 EST


David Miller <davem@xxxxxxxxxxxxx> wrote:

> Why don't you just do an skb_unshare() at the beginning when you know that
> you'll need to do that?

I was trying to defer any copying to process context rather than doing it in
softirq context to spend less time in softirq context - plus that way I can
use GFP_NOIO (kafs) or GFP_KERNEL (direct AF_RXRPC socket) rather than
GFP_ATOMIC if the api supports it.

I don't remember now why I used skb_cow_data() rather than skb_unshare() - but
it was probably because the former leaves the sk_buff object itself intact,
whereas the latter replaces it. I can switch to using skb_unshare() instead.

Question for you: how likely is a newly received buffer, through a UDP socket,
to be 'cloned'?

David