lkml.org 
[lkml]   [2022]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC v2 rcu 1/8] srcu: Convert ->srcu_lock_count and ->srcu_unlock_count to atomic
Date
On 2022-09-30, "Paul E. McKenney" <paulmck@kernel.org> wrote:
>> > - this_cpu_inc(ssp->sda->srcu_lock_count[idx]);
>> > + this_cpu_inc(ssp->sda->srcu_lock_count[idx].counter);
>>
>> Is there any particular reason that you are directly modifying
>> @counter instead of raw_cpu_ptr()+atomic_long_inc() that do you in
>> __srcu_read_lock_nmisafe() of patch 2?
>
> Performance. From what I can see, this_cpu_inc() is way faster than
> atomic_long_inc() on x86 and s390. Maybe also on loongarch. No idea
> on arm64.

Yeah, that's what I figured. I just wanted to make sure.

FWIW, the rest of the series looks pretty straight forward to me.

John

\
 
 \ /
  Last update: 2022-09-30 22:38    [W:0.076 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site