lkml.org 
[lkml]   [2018]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/4] exit: Lockless iteration over task list in mm_update_next_owner()
From
Date
On 26.04.2018 18:20, Peter Zijlstra wrote:
> On Thu, Apr 26, 2018 at 04:52:39PM +0300, Kirill Tkhai wrote:
>> In the patch I used the logic, that the below code:
>>
>> x = A;
>> spin_lock();
>> spin_unlock();
>> spin_lock();
>> spin_unlock();
>> y = B;
>>
>> cannot reorder much than:
>>
>> spin_lock();
>> x = A; <- this can't become visible later, that spin_unlock()
>> spin_unlock();
>> spin_lock();
>> y = B; <- this can't become visible earlier, than spin_lock()
>> spin_unlock();
>>
>> Is there a problem?
>
> The two stores will be ordered, but only at the strength of an
> smp_wmb(). The above construct does not imply smp_mb(). The difference
> is observable on real hardware (Power).

Ah, thanks.

But hopefully, smp_rmb() should be enough here.

\
 
 \ /
  Last update: 2018-04-26 17:57    [W:0.243 / U:1.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site