Subject: Re: [PATCH net-next-2.6 take2] ipv6: udp: Optimise multicast reception

From: Eric Dumazet <[email-masked]>
Date: Fri, 06 Nov 2009 18:24:46 +0100

Lucian Adrian Grijincu a écrit :
> În data de Vin 06 Noi 2009 19:06:30 Eric Dumazet a scris:
>> +       for (i = 0; i < count; i++) {
>> +               skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
>> +
>> +               if (skb1) {
>> +                       sk = stack[i];
>> +                       bh_lock_sock(sk);
>> +                       if (!sock_owned_by_user(sk))
>> +                               udpv6_queue_rcv_skb(sk, skb1);
>> +                       else
>> +                               sk_add_backlog(sk, skb1);
>> +                       bh_unlock_sock(sk);
>> +               }
>> +       }
> 
> Is there any reason to continue this loop if we ever get a NULL skb1?
> 
> If once we can't get a GFP_ATOMIC clone, are there merrits to calling 
> skb_clone() like crazy (in a very tight loop) (whilst holding a spin lock in 
> some cases)?
> 

Well, because of future RCU patch, I'll need to continue the loop anyway,
because sock_put() will be part of the loop.

Also, the 'final' case will at least provide the skb we already have.