All of lore.kernel.org
 help / color / mirror / Atom feed
* unregister_netdevice warnings when deleting netns
@ 2015-09-28  7:31 Anand Gurram
  2015-09-28 19:12 ` Julian Anastasov
  0 siblings, 1 reply; 9+ messages in thread
From: Anand Gurram @ 2015-09-28  7:31 UTC (permalink / raw)
  To: NETDEV

Hi,

I am currently using kernel version 3.16.7 on a linux switch.
While creating and destroying network namespaces I am observing below logs
on the console
"unregister_netdevice: waiting for lo to become free. Usage count = 1"

Can you please suggest and provide instructions on how to debug this issue.
If any fix already available can you please point me to the link.

Best Regards,
Anand

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-28  7:31 unregister_netdevice warnings when deleting netns Anand Gurram
@ 2015-09-28 19:12 ` Julian Anastasov
  2015-09-28 21:35   ` Eric W. Biederman
  2015-09-29  6:25   ` Anand Gurram
  0 siblings, 2 replies; 9+ messages in thread
From: Julian Anastasov @ 2015-09-28 19:12 UTC (permalink / raw)
  To: Anand Gurram; +Cc: NETDEV


	Hello,

On Mon, 28 Sep 2015, Anand Gurram wrote:

> I am currently using kernel version 3.16.7 on a linux switch.
> While creating and destroying network namespaces I am observing below logs
> on the console
> "unregister_netdevice: waiting for lo to become free. Usage count = 1"
> 
> Can you please suggest and provide instructions on how to debug this issue.
> If any fix already available can you please point me to the link.

	There are two commits from Linux 4.2 that may help:

commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
commit 2c17d27c36dc ("net: call rcu_read_lock early in process_backlog")

	For now I see them only in 3.2.71+ and 3.12.48+.
I think, they will appear in other stable versions too...

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-28 19:12 ` Julian Anastasov
@ 2015-09-28 21:35   ` Eric W. Biederman
  2015-09-29  6:03     ` Julian Anastasov
  2015-09-29  6:29     ` Anand Gurram
  2015-09-29  6:25   ` Anand Gurram
  1 sibling, 2 replies; 9+ messages in thread
From: Eric W. Biederman @ 2015-09-28 21:35 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Anand Gurram, NETDEV

Julian Anastasov <ja@ssi.bg> writes:

> 	Hello,
>
> On Mon, 28 Sep 2015, Anand Gurram wrote:
>
>> I am currently using kernel version 3.16.7 on a linux switch.
>> While creating and destroying network namespaces I am observing below logs
>> on the console
>> "unregister_netdevice: waiting for lo to become free. Usage count = 1"
>> 
>> Can you please suggest and provide instructions on how to debug this issue.
>> If any fix already available can you please point me to the link.
>
> 	There are two commits from Linux 4.2 that may help:
>
> commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
> commit 2c17d27c36dc ("net: call rcu_read_lock early in process_backlog")
>
> 	For now I see them only in 3.2.71+ and 3.12.48+.
> I think, they will appear in other stable versions too...

If that message repeats indefinitely it means there is a leaked
reference to the network namespaces lo device.

If the message just spits out a few times and then goes away it simply
means that something is taking a while to cleanup and drop it's
reference.

This is slightly complicated by the fact that it is not uncommon when a
network device goes away to redirect all references to itself to the lo
device.

Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-28 21:35   ` Eric W. Biederman
@ 2015-09-29  6:03     ` Julian Anastasov
  2015-09-29  6:29     ` Anand Gurram
  1 sibling, 0 replies; 9+ messages in thread
From: Julian Anastasov @ 2015-09-29  6:03 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Anand Gurram, NETDEV


	Hello,

On Mon, 28 Sep 2015, Eric W. Biederman wrote:

> Julian Anastasov <ja@ssi.bg> writes:
> 
> > On Mon, 28 Sep 2015, Anand Gurram wrote:
> >
> >> I am currently using kernel version 3.16.7 on a linux switch.
> >> While creating and destroying network namespaces I am observing below logs
> >> on the console
> >> "unregister_netdevice: waiting for lo to become free. Usage count = 1"
> >> 
> >> Can you please suggest and provide instructions on how to debug this issue.
> >> If any fix already available can you please point me to the link.
> >
> > 	There are two commits from Linux 4.2 that may help:
> >
> > commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
> > commit 2c17d27c36dc ("net: call rcu_read_lock early in process_backlog")
> >
> If that message repeats indefinitely it means there is a leaked
> reference to the network namespaces lo device.
> 
> If the message just spits out a few times and then goes away it simply
> means that something is taking a while to cleanup and drop it's
> reference.
> 
> This is slightly complicated by the fact that it is not uncommon when a
> network device goes away to redirect all references to itself to the lo
> device.

	Yes, there is a little chance with forwarding disabled,
i.e. when presence of "ipv4: Avoid crashing in ip_error" does
not matter, flying packet to leave new reference somewhere,
without crashing. But it may be another problem, of course.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-28 19:12 ` Julian Anastasov
  2015-09-28 21:35   ` Eric W. Biederman
@ 2015-09-29  6:25   ` Anand Gurram
  1 sibling, 0 replies; 9+ messages in thread
From: Anand Gurram @ 2015-09-29  6:25 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: NETDEV

Thanks Julian, I will check if these two commits work for me.

>I think, they will appear in other stable versions too...

Yes, I saw them in other versions, the fix which is suggested in those
branches didn't work for me.
Hope the above two commits help.

Regards,
Anand

On Tue, Sep 29, 2015 at 12:42 AM, Julian Anastasov <ja@ssi.bg> wrote:
>
>         Hello,
>
> On Mon, 28 Sep 2015, Anand Gurram wrote:
>
>> I am currently using kernel version 3.16.7 on a linux switch.
>> While creating and destroying network namespaces I am observing below logs
>> on the console
>> "unregister_netdevice: waiting for lo to become free. Usage count = 1"
>>
>> Can you please suggest and provide instructions on how to debug this issue.
>> If any fix already available can you please point me to the link.
>
>         There are two commits from Linux 4.2 that may help:
>
> commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
> commit 2c17d27c36dc ("net: call rcu_read_lock early in process_backlog")
>
>         For now I see them only in 3.2.71+ and 3.12.48+.
> I think, they will appear in other stable versions too...
>
> Regards
>
> --
> Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-28 21:35   ` Eric W. Biederman
  2015-09-29  6:03     ` Julian Anastasov
@ 2015-09-29  6:29     ` Anand Gurram
  2015-09-29  6:44       ` Eric W. Biederman
  1 sibling, 1 reply; 9+ messages in thread
From: Anand Gurram @ 2015-09-29  6:29 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Julian Anastasov, NETDEV

>If the message just spits out a few times and then goes away it simply
>means that something is taking a while to cleanup and drop it's
>reference.

The message just spits out few times and then goes away, I am trying
to debug why cleanup is taking long,
and where it is still referenced. Any pointers in debugging such
issues will be of great help.

Best Regards,
Anand

On Tue, Sep 29, 2015 at 3:05 AM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
> Julian Anastasov <ja@ssi.bg> writes:
>
>>       Hello,
>>
>> On Mon, 28 Sep 2015, Anand Gurram wrote:
>>
>>> I am currently using kernel version 3.16.7 on a linux switch.
>>> While creating and destroying network namespaces I am observing below logs
>>> on the console
>>> "unregister_netdevice: waiting for lo to become free. Usage count = 1"
>>>
>>> Can you please suggest and provide instructions on how to debug this issue.
>>> If any fix already available can you please point me to the link.
>>
>>       There are two commits from Linux 4.2 that may help:
>>
>> commit e9e4dd3267d0 ("net: do not process device backlog during unregistration")
>> commit 2c17d27c36dc ("net: call rcu_read_lock early in process_backlog")
>>
>>       For now I see them only in 3.2.71+ and 3.12.48+.
>> I think, they will appear in other stable versions too...
>
> If that message repeats indefinitely it means there is a leaked
> reference to the network namespaces lo device.
>
> If the message just spits out a few times and then goes away it simply
> means that something is taking a while to cleanup and drop it's
> reference.
>
> This is slightly complicated by the fact that it is not uncommon when a
> network device goes away to redirect all references to itself to the lo
> device.
>
> Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-29  6:29     ` Anand Gurram
@ 2015-09-29  6:44       ` Eric W. Biederman
  2015-09-29 16:12         ` Anand Gurram
  0 siblings, 1 reply; 9+ messages in thread
From: Eric W. Biederman @ 2015-09-29  6:44 UTC (permalink / raw)
  To: Anand Gurram; +Cc: Julian Anastasov, NETDEV

Anand Gurram <anandarao.gurram@gmail.com> writes:

>>If the message just spits out a few times and then goes away it simply
>>means that something is taking a while to cleanup and drop it's
>>reference.
>
> The message just spits out few times and then goes away, I am trying
> to debug why cleanup is taking long,
> and where it is still referenced. Any pointers in debugging such
> issues will be of great help.

The one thing I have done in the past is to instrument dev_hold
and dev_put and look where in the code the stragglers are coming from
(when I can reproduce the issue reliably).

Sometimes people have addressed this class of issue with code review,
but with a slow cleanup you can't catch this by finding a missing
dev_put.

It takes some creativity to find these as people rarely make the same
mistake twice.

Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-29  6:44       ` Eric W. Biederman
@ 2015-09-29 16:12         ` Anand Gurram
  2015-11-06  7:42           ` William Dauchy
  0 siblings, 1 reply; 9+ messages in thread
From: Anand Gurram @ 2015-09-29 16:12 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Julian Anastasov, NETDEV

Hi Julian and Eric

I tried both the patches which you have suggested, the issue is still
seen, I am observing same warning message thrown on the console
  "unregister_netdevice: waiting for lo to become free. Usage count = 1".


>Sometimes people have addressed this class of issue with code review,
>but with a slow cleanup you can't catch this by finding a missing
>dev_put.

Yeah, currently since slow cleanup is happening I am unable to trace
just by having count for dev_hold and dev_put.


Actually at the time of tearing down the name space there is an active
TCP connection present.
When this TCP connection is not present then we are not seeing this issue.

Any additional ideas and suggestions on debugging in above scenario?

Best Regards,
Anand

On Tue, Sep 29, 2015 at 12:14 PM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
> Anand Gurram <anandarao.gurram@gmail.com> writes:
>
>>>If the message just spits out a few times and then goes away it simply
>>>means that something is taking a while to cleanup and drop it's
>>>reference.
>>
>> The message just spits out few times and then goes away, I am trying
>> to debug why cleanup is taking long,
>> and where it is still referenced. Any pointers in debugging such
>> issues will be of great help.
>
> The one thing I have done in the past is to instrument dev_hold
> and dev_put and look where in the code the stragglers are coming from
> (when I can reproduce the issue reliably).
>
> Sometimes people have addressed this class of issue with code review,
> but with a slow cleanup you can't catch this by finding a missing
> dev_put.
>
> It takes some creativity to find these as people rarely make the same
> mistake twice.
>
> Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: unregister_netdevice warnings when deleting netns
  2015-09-29 16:12         ` Anand Gurram
@ 2015-11-06  7:42           ` William Dauchy
  0 siblings, 0 replies; 9+ messages in thread
From: William Dauchy @ 2015-11-06  7:42 UTC (permalink / raw)
  To: Anand Gurram; +Cc: Eric W. Biederman, Julian Anastasov, NETDEV

On Tue, Sep 29, 2015 at 6:12 PM, Anand Gurram
<anandarao.gurram@gmail.com> wrote:
> Any additional ideas and suggestions on debugging in above scenario?

You may give a try with the recent patch:
packet: race condition in packet_bind
http://www.spinics.net/lists/netdev/msg351337.html

-- 
William

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-11-06  7:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28  7:31 unregister_netdevice warnings when deleting netns Anand Gurram
2015-09-28 19:12 ` Julian Anastasov
2015-09-28 21:35   ` Eric W. Biederman
2015-09-29  6:03     ` Julian Anastasov
2015-09-29  6:29     ` Anand Gurram
2015-09-29  6:44       ` Eric W. Biederman
2015-09-29 16:12         ` Anand Gurram
2015-11-06  7:42           ` William Dauchy
2015-09-29  6:25   ` Anand Gurram

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.