lkml.org 
[lkml]   [2018]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [QUESTION] srcu: Remove the SCAN2 state
From
Date
On 2/22/2018 11:11 AM, Paul E. McKenney wrote:
> On Thu, Feb 22, 2018 at 08:57:27AM +0900, Byungchul Park wrote:
>> Hello,
>>
>> I'm sorry for bothering you, and I seem to be obviously missing
>> something, but I'm really wondering why we check try_check_zero()
>> again in the state, SCAN1, for the previous srcu_idx.
>>
>> I mean, since we've already checked try_check_zero() in the previous
>> grace period and gotten 'true' as a return value, all readers who see
>> the flipped idx via srcu_flip() won't update the src_{lock,unlock}_count
>> for the previous idx until it gets flipped back again.
>>
>> Is there any reasons we check try_check_zero() again in the state, SCAN1?
>> Is there any problems if the following patch's applied?
>
> Indeed there are! Removing the second scan exposes us to a nasty race
> condition where a reader is preempted (or interrupted or whatever) just

Indeed! I missed the cases. It should be as it is.

Thanks a lot for pointing it out.

> after fetching its counter. A detailed explanation for an essentially

--
Thanks,
Byungchul

\
 
 \ /
  Last update: 2018-02-22 06:06    [W:0.051 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site