linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Cong Wang <xiyou.wangcong@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Rolf Neugebauer <rolf.neugebauer@docker.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Justin Cormack <justin.cormack@docker.com>,
	Ian Campbell <ian.campbell@docker.com>
Subject: Re: Long delays creating a netns after deleting one (possibly RCU related)
Date: Mon, 14 Nov 2016 18:29:37 +0100	[thread overview]
Message-ID: <1479144577.3734328.787380169.651B5477@webmail.messagingengine.com> (raw)
In-Reply-To: <CAM_iQpUDnPfVayQv7Q+ZtC_2_ZbX9MRX=514gFpF3E6XY+GtSA@mail.gmail.com>

Hi Cong,

On Sat, Nov 12, 2016, at 01:55, Cong Wang wrote:
> On Fri, Nov 11, 2016 at 4:23 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> >
> > Ah!  This net_mutex is different than RTNL.  Should synchronize_net() be
> > modified to check for net_mutex being held in addition to the current
> > checks for RTNL being held?
> >
> 
> Good point!
> 
> Like commit be3fc413da9eb17cce0991f214ab0, checking
> for net_mutex for this case seems to be an optimization, I assume
> synchronize_rcu_expedited() and synchronize_rcu() have the same
> behavior...
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index eaad4c2..3415b6b 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -7762,7 +7762,7 @@ EXPORT_SYMBOL(free_netdev);
>  void synchronize_net(void)
>  {
>         might_sleep();
> -       if (rtnl_is_locked())
> +       if (rtnl_is_locked() || lockdep_is_held(&net_mutex))
>                 synchronize_rcu_expedited();

I don't think we should depend on lockdep for this check but rather use
mutex_is_locked here (I think it would fail to build like this without
CONFIG_LOCKDEP).

Bye,
Hannes

      parent reply	other threads:[~2016-11-14 17:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 15:42 Long delays creating a netns after deleting one (possibly RCU related) Rolf Neugebauer
2016-11-10 17:37 ` Cong Wang
2016-11-10 21:24   ` Paul E. McKenney
2016-11-11 13:11     ` Rolf Neugebauer
2016-11-12  0:23       ` Paul E. McKenney
2016-11-12  0:55         ` Cong Wang
2016-11-14  6:47           ` Cong Wang
2016-11-14 16:24             ` Paul E. McKenney
2016-11-14 17:44               ` Cong Wang
2016-11-14 18:14                 ` Paul E. McKenney
2016-11-14 22:12                   ` Eric W. Biederman
2016-11-14 22:46                     ` Eric Dumazet
2016-11-14 23:09                       ` Eric Dumazet
2016-11-18  0:31                         ` Jarno Rajahalme
2016-11-19  0:38                         ` Jarno Rajahalme
2016-11-19  0:41                           ` Eric Dumazet
2016-11-14 17:29           ` Hannes Frederic Sowa [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=1479144577.3734328.787380169.651B5477@webmail.messagingengine.com \
    --to=hannes@stressinduktion.org \
    --cc=ian.campbell@docker.com \
    --cc=justin.cormack@docker.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rolf.neugebauer@docker.com \
    --cc=xiyou.wangcong@gmail.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).