lkml.org 
[lkml]   [2018]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] exit: Lockless iteration over task list in mm_update_next_owner()
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).

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