bonding: remove the no effect lock for bond_select_active_slave()
authordingtianhong <dingtianhong@huawei.com>
Fri, 13 Dec 2013 02:19:32 +0000 (10:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Dec 2013 06:58:01 +0000 (01:58 -0500)
commitb2e7aceb00b2621431e220748f7158b131b89e7b
tree2f2a187827d9203946d12877971479bac4c8dff0
parente57a784d8cae429f5b697fe55abf420181d9ff09
bonding: remove the no effect lock for bond_select_active_slave()

The bond slave list was no longer protected by bond lock and only
protected by RTNL or RCU, so anywhere that use bond lock to protect
slave list is meaningless.

remove the release and acquire bond lock for bond_select_active_slave().

The curr_active_slave could only be changed in 3 place:

1. enslave slave.
2. release slave.
3. change_active_slave.

all above place were holding bond lock, RTNL and curr_slave_lock
together, it is tedious and meaningless, obviously bond lock is no
need here, but RTNL or curr_slave_lock is needed, so if you want
to access active slave, you have to choose one lock, RTNL or
curr_slave_lock, if RTNL is exist, no need to add curr_slave_lock,
otherwise curr_slave_lock is better, because of the performance.

there are several place calling bond_select_active_slave() and
bond_change_active_slave(), the next step I will clean these place
and remove the no effect lock.

there are some document changed together when update the function.

Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
Suggested-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c