Re: [PATCH 4/4] exit: Lockless iteration over task list in mm_update_next_owner()
From: Kirill Tkhai
Date: Thu Apr 26 2018 - 11:57:14 EST
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;
>> y = B;
>> cannot reorder much than:
>> x = A; <- this can't become visible later, that spin_unlock()
>> y = B; <- this can't become visible earlier, than spin_lock()
>> 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).
But hopefully, smp_rmb() should be enough here.