lkml.org 
[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tipc-discussion] [PATCH net/tipc] Replace rcu_swap_protected() with rcu_replace_pointer()
From
Date
On 12/11/19 10:00 AM, Tuong Lien Tong wrote:
>>
>> /* Move passive key if any */
>> if (key.passive) {
>> - tipc_aead_rcu_swap(rx->aead[key.passive], tmp2, &rx->lock);
>> + tmp2 = rcu_replace_pointer(rx->aead[key.passive], tmp2,
> &rx->lock);
> The 3rd parameter should be the lockdep condition checking instead of the
> spinlock's pointer i.e. "lockdep_is_held(&rx->lock)"?
> That's why I'd prefer to use the 'tipc_aead_rcu_swap ()' macro, which is
> clear & concise at least for the context here. It might be re-used later as
> well...
>

Right. The 3rd parameter of rcu_replace_pointer() should be
"lockdep_is_held(&rx->lock)" instead of "&rx->lock".

\
 
 \ /
  Last update: 2019-12-11 05:57    [W:0.075 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site