2.6.29.1: unregister_netdevice problem
Subsystems (4)
Eventually I have an increased load average without apparent reason. When I reboot the server in such a case, I get infinitely repeating messages on the console:
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4
eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Signature · 1 line
Alexander.
Quoted 9 lines · Alexander V. Lukyanov
Eventually I have an increased load average without apparent reason. When I reboot the server in such a case, I get infinitely repeating messages on the console:
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Infinitely repeating unregister_netdevice messages means something isn't releasing it's reference count to your network device.
There really isn't enough information in your email to figure out what you were doing that, or what piece of code triggered this.
Eric
Quoted 13 lines · On Thu, 23 April 2009 [email protected] (Eric W. Biederman) wrote:
Quoted 10 lines · Alexander V. Lukyanov
Eventually I have an increased load average without apparent reason. When I reboot the server in such a case, I get infinitely repeating messages on the console:
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller:
Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Quoted 7 lines
CC netdev where someone might have a better clue.Infinitely repeating
unregister_netdevicemessages means something isn't releasing it's reference count to your network device.There really isn't enough information in your email to figure out what you were doing that, or what piece of code triggered this.
A few I similar cases I have encountered are related to:
vlan, netconsole
If you attempt to rmmod the driver of a network interface for which you have a vlan or netconsole setup on top of you end up with this kind of lock.
At least the two above do not react of removal attempt notifications and thus keep the network device referenced.
Bruno
Quoted 5 lines · Alexander V. Lukyanov
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Ok, now I did manually 'vconfig rem eth0.2' and I get these repeated messages. How do I find out what exactly holds the interface being used?
I have killed most of non-kernel processes, eth0.2 is still used. LA=1, but the cpu is idle.
top - 09:34:26 up 4 days, 23:55, 2 users, load average: 1.00, 1.12, 3.55
Tasks: 56 total, 1 running, 55 sleeping, 0 stopped, 0 zombie Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 3356308k total, 1165044k used, 2191264k free, 443536k buffers Swap: 3212920k total, 712k used, 3212208k free, 493568k cached
Signature · 1 line
Alexander..
Quoted 9 lines · Alexander V. Lukyanov
Quoted 5 lines · Alexander V. Lukyanov
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Ok, now I did manually 'vconfig rem eth0.2' and I get these repeated messages. How do I find out what exactly holds the interface being used?
BTW, it looks like all vlan interfaces (I have many of them) have similar problem, when it happens - every few days:
unregister_netdevice: waiting for eth0.907 to become free. Usage count = 20
and when I run a `vconfig rem', I cannot run another one. It s(t)ucks.
Signature · 1 line
Alexander..
Alexander V. Lukyanov wrote, On 04/28/2009 02:57 PM:
Quoted 10 lines · Alexander V. Lukyanov
Quoted 8 lines · Alexander V. Lukyanov
Quoted 5 lines
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Ok, now I did manually 'vconfig rem eth0.2' and I get these repeated messages. How do I find out what exactly holds the interface being used?
Quoted 7 lines
BTW, it looks like all vlan interfaces (I have many of them) have similar problem, when it happens - every few days:
unregister_netdevice: waiting for eth0.907 to become free. Usage count = 20and when I run a `vconfig rem', I cannot run another one. It s(t)ucks.
Do you mean if you wait a bit longer (until the first one is really removed) before running another one, it doesn't s(t)uck? Is there a change e.g. wrt. 2.6.28?
Jarek P.
Quoted 1 line · Jarek Poplawski
Do you mean if you wait a bit longer (until the first one is really removed)
The problem is that it is never removed. I waited for at least 30 minutes.
Quoted 2 lines
before running another one, it doesn't s(t)uck? Is there a change e.g. wrt. 2.6.28?
I mean, 'vconfig rem' on another interface stucks if the previous vconfig has not finished, and it never finishes. So I cannot check if other vlan interfaces have the same 'refcnt' problem. So far I tried 'vconfig rem' on two vlan interfaces and I have a dozen.
Again, the problem only happens after I notice surprisingly high LA (30 instead of 2-6) and interactive slowness. When it happens, I check network usage, disk usage, cpu usage, mem usage - they are normal or even lower than usual.
The server is running transparent squid and named. The last kernel version was 2.6.27.21 and it did not have this problem.
Signature · 1 line
Alexander.
Quoted 13 lines · Alexander V. Lukyanov
Quoted 1 line · Jarek Poplawski
Do you mean if you wait a bit longer (until the first one is really removed)
The problem is that it is never removed. I waited for at least 30 minutes.
Quoted 2 lines
before running another one, it doesn't s(t)uck? Is there a change e.g. wrt. 2.6.28?
I mean, 'vconfig rem' on another interface stucks if the previous vconfig has not finished, and it never finishes. So I cannot check if other vlan interfaces have the same 'refcnt' problem. So far I tried 'vconfig rem' on two vlan interfaces and I have a dozen.
Quoted 7 lines
Again, the problem only happens after I notice surprisingly high LA (30 instead of 2-6) and interactive slowness. When it happens, I check network usage, disk usage, cpu usage, mem usage - they are normal or even lower than usual.
The server is running transparent squid and named. The last kernel version was 2.6.27.21 and it did not have this problem.
So looks like a regression. Alas this thing could be hard to debug and still more data is needed. For the beginning maybe: .config, dmesg, and a few SysRq logs while this happens e.g. Alt-PrtScr with t, d, w, q (gzipped or as attachments to a bugzilla report). (If it's not a big problem trying 2.6.28.9 could be helpful too.)
Thanks,
Jarek P.
Quoted 5 lines · Jarek Poplawski
So looks like a regression. Alas this thing could be hard to debug and still more data is needed. For the beginning maybe: .config, dmesg, and a few SysRq logs while this happens e.g. Alt-PrtScr with t, d, w, q (gzipped or as attachments to a bugzilla report). (If it's not a big problem trying 2.6.28.9 could be helpful too.)
It happened again with 2.6.29.2. Here is the requested info.
Signature · 1 line
Alexander..
Quoted 8 lines · Alexander V. Lukyanov
Quoted 5 lines · Jarek Poplawski
So looks like a regression. Alas this thing could be hard to debug and still more data is needed. For the beginning maybe: .config, dmesg, and a few SysRq logs while this happens e.g. Alt-PrtScr with t, d, w, q (gzipped or as attachments to a bugzilla report). (If it's not a big problem trying 2.6.28.9 could be helpful too.)
It happened again with 2.6.29.2. Here is the requested info.
I can't see anything suspicious for now, except these UDP and TCP warnings. Did you see similar messages with 2.6.27? Btw., could this eth0.987 be "connected" with any of this traffic? (IP# ?)
Thanks,
Jarek P.
Quoted 2 lines · Jarek Poplawski
I can't see anything suspicious for now, except these UDP and TCP warnings. Did you see similar messages with 2.6.27? Btw., could this
Yes. Such messages show up with any kernel version.
Quoted 1 line
eth0.987 be "connected" with any of this traffic? (IP# ?)
No, eth0.987 is only used for traffic output.
BTW, it seems that only actively used vlan interfaces have the problem (even when the traffic stops). Other vlan interfaces with little traffic can be removed with no problems.
Signature · 1 line
Alexander..
Quoted 6 lines · Alexander V. Lukyanov
Quoted 2 lines · Jarek Poplawski
I can't see anything suspicious for now, except these UDP and TCP warnings. Did you see similar messages with 2.6.27? Btw., could this
Yes. Such messages show up with any kernel version.
Quoted 7 lines
Quoted 1 line
eth0.987 be "connected" with any of this traffic? (IP# ?)
No, eth0.987 is only used for traffic output.
BTW, it seems that only actively used vlan interfaces have the problem (even when the traffic stops). Other vlan interfaces with little traffic can be removed with no problems.
OK, I'll try to look around this, but how about trying 2.6.28.10 in the meantime? It could limit "a bit" the number of places/lines.
Jarek P.
Quoted 9 lines · Jarek Poplawski
Quoted 8 lines · Alexander V. Lukyanov
Quoted 2 lines · Jarek Poplawski
I can't see anything suspicious for now, except these UDP and TCP warnings. Did you see similar messages with 2.6.27? Btw., could this
Yes. Such messages show up with any kernel version.
Quoted 1 line
eth0.987 be "connected" with any of this traffic? (IP# ?)
Quoted 8 lines
Quoted 5 lines
No, eth0.987 is only used for traffic output.
BTW, it seems that only actively used vlan interfaces have the problem (even when the traffic stops). Other vlan interfaces with little traffic can be removed with no problems.
OK, I'll try to look around this, but how about trying 2.6.28.10 in the meantime? It could limit "a bit" the number of places/lines.
Looks like 2.6.28.10 does not have this refcnt problem. Also, after I have reversed net/ipv4/route.c changes from 2.6.29, the problem does not occur either.
Signature · 1 line
Alexander..
On Fri, May 15, 2009 at 11:19:46AM +0400, Alexander V. Lukyanov wrote:
...
Quoted 2 lines
Looks like 2.6.28.10 does not have this refcnt problem. Also, after I have reversed
net/ipv4/route.cchanges from 2.6.29, the problem does not occur either.
Very nice work! It should be a piece of cake now - there were not much changes. I'll look at it, as usual ;-), but, of course if it's possible, it would be great to try "in the meantime" with reverted the biggest of them append below.
Thanks,
Jarek P.
---
commit 1080d709fb9d8cd4392f93476ee46a9d6ea05a5b
Author: Neil Horman <[email protected]> Date: Mon Oct 27 12:28:25 2008 -0700
net: implement emergency route cache rebulds when gc_elasticity is exceeded
This is a patch to provide on demand route cache rebuilding. Currently, our route cache is rebulid periodically regardless of need. This introduced unneeded periodic latency. This patch offers a better approach. Using code provided by Eric Dumazet, we compute the standard deviation of the average hash bucket chain length while running rt_check_expire. Should any given chain length grow to larger that average plus 4 standard deviations, we trigger an emergency hash table rebuild for that net namespace. This allows for the common case in which chains are well behaved and do not grow unevenly to not incur any latency at all, while those systems (which may be being maliciously attacked), only rebuild when the attack is detected. This patch take 2 other factors into account:
1) chains with multiple entries that differ by attributes that do not affect the hash value are only counted once, so as not to unduly bias system to rebuilding if features like QOS are heavily used
2) if rebuilding crosses a certain threshold (which is adjustable via the added sysctl in this patch), route caching is disabled entirely for that net namespace, since constant rebuilding is less efficient that no caching at all
Tested successfully by me.
Documentation/networking/ip-sysctl.txt +6 -0
@@ -27,6 +27,12 @@ min_adv_mss - INTEGER The advertised MSS depends on the first hop route MTU, but will never be lower than this setting. +rt_cache_rebuild_count - INTEGER + The per net-namespace route cache emergency rebuild threshold. + Any net-namespace having its route cache rebuilt due to + a hash bucket chain being too long more than this many times + will have its route caching disabled + IP Fragmentation: ipfrag_high_thresh - INTEGER
include/net/netns/ipv4.h +2 -0
@@ -49,6 +49,8 @@ struct netns_ipv4 {int sysctl_icmp_ratelimit;int sysctl_icmp_ratemask;int sysctl_icmp_errors_use_inbound_ifaddr; +int sysctl_rt_cache_rebuild_count; +int current_rt_cache_rebuild_count;struct timer_list rt_secret_timer;atomic_t rt_genid;
net/ipv4/route.c +130 -2
269 lines not on this page · raw message
net/ipv4/sysctl_net_ipv4.c +12 -0
@@ -795,6 +795,14 @@ static struct ctl_table ipv4_net_table[] = { .mode = 0644, .proc_handler = &proc_dointvec }, + { + .ctl_name = CTL_UNNUMBERED, + .procname = "rt_cache_rebuild_count", + .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec + }, { } };
@@ -827,8 +835,12 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) &net->ipv4.sysctl_icmp_ratelimit; table[5 ].data = &net->ipv4.sysctl_icmp_ratemask; + table[6 ].data = + &net->ipv4.sysctl_rt_cache_rebuild_count; } + net->ipv4.sysctl_rt_cache_rebuild_count =4 ; + net->ipv4.ipv4_hdr =register_net_sysctl_table (net, net_ipv4_ctl_path, table);if (net->ipv4.ipv4_hdr ==NULL )
Quoted 9 lines · Jarek Poplawski
On Fri, May 15, 2009 at 11:19:46AM +0400, Alexander V. Lukyanov wrote:
...Quoted 2 lines
Looks like 2.6.28.10 does not have this refcnt problem. Also, after I have reversed
net/ipv4/route.cchanges from 2.6.29, the problem does not occur either.Very nice work! It should be a piece of cake now - there were not much changes. I'll look at it, as usual ;-), but, of course if it's possible, it would be great to try "in the meantime" with reverted the biggest of them append below.
I suspect the problem occurs when cand==rthi.
Signature · 1 line
Alexander.
Quoted 6 lines · Alexander V. Lukyanov
Quoted 5 lines · Jarek Poplawski
On Fri, May 15, 2009 at 11:19:46AM +0400, Alexander V. Lukyanov wrote:
...Quoted 2 lines
Looks like 2.6.28.10 does not have this refcnt problem. Also, after I have reversed
net/ipv4/route.cchanges from 2.6.29, the problem does not occur either.
Quoted 6 lines
Quoted 4 lines
Very nice work! It should be a piece of cake now - there were not much changes. I'll look at it, as usual ;-), but, of course if it's possible, it would be great to try "in the meantime" with reverted the biggest of them append below.
I suspect the problem occurs when cand==rthi.
Looks like good catch! (But there could be more than this.) Then, of course it would be interesting to try first some fix (like nulling rthi after rt_free(cand), I guess).
Jarek P.
Jarek Poplawski wrote, On 05/15/2009 12:12 PM:
Quoted 10 lines · Alexander V. Lukyanov
Quoted 9 lines · Jarek Poplawski
Quoted 8 lines · Alexander V. Lukyanov
...
Quoted 2 lines
Looks like 2.6.28.10 does not have this refcnt problem. Also, after I have reversed
net/ipv4/route.cchanges from 2.6.29, the problem does not occur either.Very nice work! It should be a piece of cake now - there were not much changes. I'll look at it, as usual ;-), but, of course if it's possible, it would be great to try "in the meantime" with reverted the biggest of them append below.
Quoted 5 lines
Quoted 1 line
I suspect the problem occurs when cand==rthi.
Looks like good catch! (But there could be more than this.) Then, of course it would be interesting to try first some fix (like nulling rthi after
rt_free(cand), I guess).
On the other hand, since this looks like quite obvious bug (even if it doesn't fix your problem), feel free to send here a patch fixing it any way you like without waiting for the final test results (Cc-ing authors of the offending patch, I hope).
Jarek P.
Quoted 5 lines · Alexander V. Lukyanov
unregister_netdevice: waiting for eth0.2 to become free. Usage count = 4eth0.2 is a vlan interface, eth0 is 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Ok, now I did manually 'vconfig rem eth0.2' and I get these repeated messages. How do I find out what exactly holds the interface being used?
I have killed most of non-kernel processes, eth0.2 is still used. LA=1, but the cpu is idle.
top - 09:34:26 up 4 days, 23:55, 2 users, load average: 1.00, 1.12, 3.55
Tasks: 56 total, 1 running, 55 sleeping, 0 stopped, 0 zombie Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 3356308k total, 1165044k used, 2191264k free, 443536k buffers Swap: 3212920k total, 712k used, 3212208k free, 493568k cached
Signature · 1 line
Alexander..