Re: [PATCH net-next 5/5] bonding: initial RCU conversion
From: Ding Tianhong <hidden>
Date: 2013-08-01 06:48:22
On 2013/7/31 23:12, Nikolay Aleksandrov wrote:
This patch does the initial bonding conversion to RCU. After it the following modes are protected by RCU alone: roundrobin, active-backup, broadcast and xor. Modes ALB/TLB and 3ad still acquire bond->lock for reading, and will be dealt with later. curr_active_slave needs to be dereferenced via rcu in the converted modes because the only thing protecting the slave after this patch is rcu_read_lock, so we need the proper barrier for weakly ordered archs and to make sure we don't have stale pointer. It's not tagged with __rcu yet because there's still work to be done to remove the curr_slave_lock, so sparse will complain when rcu_assign_pointer and rcu_dereference are used, but the alternative to use rcu_dereference_protected would've created much bigger code churn which is more difficult to test and review. That will be converted in time. Signed-off-by: Nikolay Aleksandrov <redacted>
great job! but I think you miss come place to replace by rcu protect. example: bonding_show_active_slave() still has curr = bond->curr_active_slave, so I think you could replace them all and send together.