[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140715111522.GE28235@mikrodark.usersys.redhat.com>
Date: Tue, 15 Jul 2014 13:15:22 +0200
From: Veaceslav Falico <vfalico@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
Nikolay Aleksandrov <nikolay@...hat.com>,
Mahesh Bandewar <maheshb@...gle.com>
Subject: Re: [PATCH net-next 3/3] bonding: add proper __rcu annotation for
curr_active_slave
On Tue, Jul 15, 2014 at 12:52:49PM +0200, Eric Dumazet wrote:
>On Tue, 2014-07-15 at 12:38 +0200, Veaceslav Falico wrote:
>> On Tue, Jul 15, 2014 at 02:46:44AM -0700, Eric Dumazet wrote:
>> >RCU was added to bonding in linux-3.12 but lacked proper sparse annotations.
>> >
>> >Using __rcu annotation actually helps to spot all accesses to bond->curr_active_slave
>> >are correctly protected, with LOCKDEP support.
>> >
>> >Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>>
>> Thanks a lot for cleaning this up, it's really a huge mess here...
>>
>> One question though:
>>
>> ...snip...
>> >@@ -2046,7 +2051,7 @@ static void bond_miimon_commit(struct bonding *bond)
>> > bond_alb_handle_link_change(bond, slave,
>> > BOND_LINK_DOWN);
>> >
>> >- if (slave == bond->curr_active_slave)
>> >+ if (slave == rcu_access_pointer(bond->curr_active_slave))
>>
>> I guess you've meant rtnl_dereference()? As bond_miimon_commit() is ujnder
>> rtnl, not under rcu.
>
>This does not really matter here, as we only perform an equality test.
>
>(We dont read the pointer, then dereference it)
>
>rcu_access_pointer() is fine in this context, this makes sparse happy
>mostly.
Fair enough.
Acked-by: Veaceslav Falico <vfalico@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists