Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1521909
| From | Hannes Frederic Sowa <hannes@stressinduktion.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: Long delays creating a netns after deleting one (possibly RCU related) |
| Date | 2016-11-14 18:30 +0100 |
| Message-ID | <sDteW-1wp-47@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <sC1uq-MX-33@gated-at.bofh.it> <sC550-3nm-25@gated-at.bofh.it> <sCjUl-4Mx-5@gated-at.bofh.it> <sCumJ-38N-23@gated-at.bofh.it> <sCuPL-3iv-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Long delays creating a netns after deleting one (possibly RCU related) "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-12 01:30 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Cong Wang <xiyou.wangcong@gmail.com> - 2016-11-12 02:00 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Cong Wang <xiyou.wangcong@gmail.com> - 2016-11-14 07:50 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-14 17:30 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Cong Wang <xiyou.wangcong@gmail.com> - 2016-11-14 18:50 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-14 19:20 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) ebiederm@xmission.com (Eric W. Biederman) - 2016-11-14 23:20 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Eric Dumazet <eric.dumazet@gmail.com> - 2016-11-14 23:50 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Eric Dumazet <eric.dumazet@gmail.com> - 2016-11-15 00:10 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Jarno Rajahalme <jarno.rajahalme@gmail.com> - 2016-11-18 01:40 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Jarno Rajahalme <jarno.rajahalme@gmail.com> - 2016-11-19 01:40 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Eric Dumazet <eric.dumazet@gmail.com> - 2016-11-19 01:50 +0100
Re: Long delays creating a netns after deleting one (possibly RCU related) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-11-14 18:30 +0100
csiph-web