All of lore.kernel.org
 help / color / mirror / Atom feed
From: subashab@codeaurora.org
To: "Eric Dumazet" <eric.dumazet@gmail.com>
Cc: "Erik Kline" <ek@google.com>, "Netdev" <netdev@vger.kernel.org>,
	"Hannes Frederic Sowa" <hannes@stressinduktion.org>
Subject: Re: [PATCH net] ipv6: addrconf: Fix recursive spin lock call
Date: Tue, 2 Feb 2016 00:07:46 -0000	[thread overview]
Message-ID: <db0e644012c1902f3e0fb3dd0b0a145f.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <1454355982.7627.185.camel@edumazet-glaptop2.roam.corp.google.com>

> On Mon, 2016-02-01 at 11:37 -0800, Eric Dumazet wrote:
>
>> I would rather try :
>>
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index 38eeddedfc21..d6b7ab07f914 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -3538,6 +3538,7 @@ static void addrconf_dad_begin(struct inet6_ifaddr
>> *ifp)
>>  {
>>  	struct inet6_dev *idev = ifp->idev;
>>  	struct net_device *dev = idev->dev;
>> +	bool notify = false;
>>
>>  	addrconf_join_solict(dev, &ifp->addr);
>>
>> @@ -3583,7 +3584,8 @@ static void addrconf_dad_begin(struct inet6_ifaddr
>> *ifp)
>>  			/* Because optimistic nodes can use this address,
>>  			 * notify listeners. If DAD fails, RTM_DELADDR is sent.
>>  			 */
>> -			ipv6_ifa_notify(RTM_NEWADDR, ifp);
>> +			notify = true;
>> +			in6_ifa_hold(ifp);
>
> Actually the in6_ifa_hold() is not needed.
>
>>  		}
>>  	}
>>
>> @@ -3591,6 +3593,10 @@ static void addrconf_dad_begin(struct
>> inet6_ifaddr *ifp)
>>  out:
>>  	spin_unlock(&ifp->lock);
>>  	read_unlock_bh(&idev->lock);
>> +	if (notify) {
>> +		ipv6_ifa_notify(RTM_NEWADDR, ifp);
>> +		in6_ifa_put(ifp);
>
> And in6_ifa_put() not needed once in6_ifa_hold() is removed.
>
>> +	}
>>  }
>>
>>  static void addrconf_dad_start(struct inet6_ifaddr *ifp)
>>
>>

Thanks Eric. I tested the scenario with your suggestion and I don't see a
RCU stall now. I will send out v2 of this patch.

      reply	other threads:[~2016-02-02  0:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 19:13 [PATCH net] ipv6: addrconf: Fix recursive spin lock call subashab
2016-02-01 19:37 ` Eric Dumazet
2016-02-01 19:46   ` Eric Dumazet
2016-02-02  0:07     ` subashab [this message]

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=db0e644012c1902f3e0fb3dd0b0a145f.squirrel@www.codeaurora.org \
    --to=subashab@codeaurora.org \
    --cc=ek@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.