netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Lucian Adrian Grijincu <lgrijincu@ixiacom.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, opurdila@ixiacom.com
Subject: Re: [PATCH net-next-2.6 take2] ipv6: udp: Optimise multicast reception
Date: Fri, 06 Nov 2009 18:24:46 +0100	[thread overview]
Message-ID: <4AF45BDE.4090501@gmail.com> (raw)
In-Reply-To: <200911061919.47100.lgrijincu@ixiacom.com>

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.



  reply	other threads:[~2009-11-06 17:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05 18:33 [PATCH 1/2] udp: cleanup __udp4_lib_mcast_deliver Lucian Adrian Grijincu
2009-11-06  8:42 ` David Miller
2009-11-06 14:04   ` Lucian Adrian Grijincu
2009-11-06 15:10     ` Eric Dumazet
2009-11-06 15:59       ` [PATCH net-next-2.6] udp: Optimise multicast reception Eric Dumazet
2009-11-06 16:30         ` [PATCH net-next-2.6] ipv6: " Eric Dumazet
2009-11-06 16:35           ` Eric Dumazet
2009-11-06 17:06             ` [PATCH net-next-2.6 take2] " Eric Dumazet
2009-11-06 17:19               ` Lucian Adrian Grijincu
2009-11-06 17:24                 ` Eric Dumazet [this message]
2009-11-06 17:54                   ` Eric Dumazet
2009-11-06 17:59                     ` Lucian Adrian Grijincu
2009-11-06 18:03                       ` Eric Dumazet
2009-11-06 16:35         ` [PATCH net-next-2.6] " Lucian Adrian Grijincu
2009-11-06 16:54           ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF45BDE.4090501@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=lgrijincu@ixiacom.com \
    --cc=netdev@vger.kernel.org \
    --cc=opurdila@ixiacom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).