]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: fix system hang due to fast igmp timer rescheduling
authorNikolay Aleksandrov <nikolay@redhat.com>
Thu, 1 Aug 2013 09:51:42 +0000 (11:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2013 22:52:49 +0000 (15:52 -0700)
commit53d7f7f685ca2b16114054002f6b1b6474d8c6c0
tree9ebf458d36610e004303d36cd83ae5992354594e
parent2257160db661adc06cbb153334c17c4430193b41
bonding: fix system hang due to fast igmp timer rescheduling

After commit d19dd9c641 ("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>
drivers/net/bonding/bond_main.c