Messages in this thread | | | Date | Thu, 5 Nov 2015 17:49:51 +0100 | From | Peter Zijlstra <> | Subject | Re: [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(); }
| |