diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2013-08-01 05:51:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-01 18:52:49 -0400 |
commit | 4beac0293fabb68125e1a9d2ce81d89343f8702d (patch) | |
tree | 9ebf458d36610e004303d36cd83ae5992354594e /drivers/net/bonding | |
parent | 9ab5ec59c8a9cc0e4b94252b48200b6023c716aa (diff) |
bonding: fix system hang due to fast igmp timer rescheduling
After commit 4aa5dee4d9 ("net: convert resend IGMP to notifier event")
we try to acquire rtnl in bond_resend_igmp_join_requests but it can be
scheduled with rtnl already held (e.g. when bond_change_active_slave is
called with rtnl) causing a loop of immediate reschedules + calls because
rtnl_trylock fails each time since it's being already held.
For me this issue leads to system hangs very easy:
modprobe bonding; ifconfig bond0 up; ifenslave bond0 eth0; rmmod
bonding;
The fix is to introduce a small (1 jiffy) delay which is enough for the
sections holding rtnl to finish without putting any strain on the system.
Also adjust the timer in bond_change_active_slave to be 1 jiffy, since
most of the time it's called with rtnl already held.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index da3af631f21b..bc3578e4980a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -723,7 +723,7 @@ static int bond_set_allmulti(struct bonding *bond, int inc) | |||
723 | static void bond_resend_igmp_join_requests(struct bonding *bond) | 723 | static void bond_resend_igmp_join_requests(struct bonding *bond) |
724 | { | 724 | { |
725 | if (!rtnl_trylock()) { | 725 | if (!rtnl_trylock()) { |
726 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); | 726 | queue_delayed_work(bond->wq, &bond->mcast_work, 1); |
727 | return; | 727 | return; |
728 | } | 728 | } |
729 | call_netdevice_notifiers(NETDEV_RESEND_IGMP, bond->dev); | 729 | call_netdevice_notifiers(NETDEV_RESEND_IGMP, bond->dev); |
@@ -1084,7 +1084,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1084 | ((USES_PRIMARY(bond->params.mode) && new_active) || | 1084 | ((USES_PRIMARY(bond->params.mode) && new_active) || |
1085 | bond->params.mode == BOND_MODE_ROUNDROBIN)) { | 1085 | bond->params.mode == BOND_MODE_ROUNDROBIN)) { |
1086 | bond->igmp_retrans = bond->params.resend_igmp; | 1086 | bond->igmp_retrans = bond->params.resend_igmp; |
1087 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); | 1087 | queue_delayed_work(bond->wq, &bond->mcast_work, 1); |
1088 | } | 1088 | } |
1089 | } | 1089 | } |
1090 | 1090 | ||