From: Gao feng <gaofeng@cn.fujitsu.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: ebiederm@xmission.com, davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] net: dev: fix the incorrect hold of net namespace's lo device
Date: Thu, 23 Aug 2012 11:09:41 +0800 [thread overview]
Message-ID: <50359EF5.5080008@cn.fujitsu.com> (raw)
In-Reply-To: <1345634667.5158.1114.camel@edumazet-glaptop>
于 2012年08月22日 19:24, Eric Dumazet 写道:
> On Wed, 2012-08-22 at 19:00 +0800, Gao feng wrote:
>
>> Hi Eric
>>
>> I saw your patch and think this patch is clear and doesn't change too much logic.
>>
>> I test your patch, it not fix this problem.
>>
>> In my test case,when moving a net device to another net namespace,
>> Because you patch delete NETDEV_UNREGISTER event from dst_dev_event,
>> we will just put dst entries into the dst garbage list in event
>> NETDEV_DOWN,without call dst_ifdown to change these dst entries' device
>> to the lo device,and now this net device belongs to the new net namespace.
>>
>
> Then fix the "moving a net device to another net namespace", instead
> of slowing down other common operations.
>
okay, I will send a patch to fix this problem after your patch beeing applied.
> dev_change_net_namespace() is probably a better place to put your patch
>
>> After the net device beeing moved to another net namespace, I rmmod this
>> net device's driver,this will trigger the new added event NETDEV_UNREGISTER_FINISH,
>> so in dst_dev_event,we will change these dst entries's device to the new net
>> namespace's lo device,and this will make the referenct count of the new net namespace's
>> lo device incorrect. when we exit the new net namespace,this emg message is still exist.
>>
>> Message from syslogd@Donkey at Aug 22 18:50:13 ...
>> kernel:[ 1161.979036] unregister_netdevice: waiting for lo to become free. Usage count = 1
>>
>> And because net_mutex is locked here,so we can't create new net namespace.
>>
>>> rcu_barrier() at this place will kill some workloads.
>>>
>>
>> I think this will only add some workloads when unregister a net device.
>> Do I miss something?
>
> Yes, rcu_barrier() at this point is killing performance, because we hold
> RTNL.
>
> We worked hard to batch things, your patch is a huge step backward.
>
Get it,thanks for your explanation.
next prev parent reply other threads:[~2012-08-23 3:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 8:31 [PATCH] net: dev: fix the incorrect hold of net namespace's lo device Gao feng
2012-08-22 8:39 ` Eric Dumazet
2012-08-22 11:00 ` Gao feng
2012-08-22 11:24 ` Eric Dumazet
2012-08-23 3:09 ` Gao feng [this message]
2012-08-23 3:13 ` 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=50359EF5.5080008@cn.fujitsu.com \
--to=gaofeng@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=eric.dumazet@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox