lkml.org 
[lkml]   [2015]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tip/locking/core v9 2/6] locking/qspinlock: prefetch next node cacheline
On Thu, Nov 05, 2015 at 11:42:27AM -0500, Waiman Long wrote:
> If we observe next, we will observe val != tail sooner or later. It is not
> possible for it to clear the tail code in the lock. The tail xchg will
> guarantee that.
>
> Another alternative is to do something like
>
> + if (!next)
> while (!(next = READ_ONCE(node->next)))
> cpu_relax();
>

Yes maybe, although the main reason I fell over this was because it was
a separate change (and not mentioned in the Changelog).

Although the above would need braces (per CodingStyle), so:

if (!next) {
while (!(next = READ_ONCE(node->next)))
cpu_relax();
}





\
 
 \ /
  Last update: 2015-11-05 18:01    [W:0.057 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site