Lines Matching full:next
16 struct optimistic_spin_node *next, *prev; member
45 * Get a stable @node->next pointer, either for unlock() or unqueue() purposes.
72 * We must xchg() the @node->next value, because if we were to in osq_wait_next()
74 * @node->next might complete Step-A and think its @prev is in osq_wait_next()
79 * wait for a new @node->next from its Step-C. in osq_wait_next()
81 if (node->next) { in osq_wait_next()
82 struct optimistic_spin_node *next; in osq_wait_next() local
84 next = xchg(&node->next, NULL); in osq_wait_next()
85 if (next) in osq_wait_next()
86 return next; in osq_wait_next()
96 struct optimistic_spin_node *prev, *next; in osq_lock() local
101 node->next = NULL; in osq_lock()
122 * prev->next = node next->prev = prev // unqueue-C in osq_lock()
124 * Here 'node->prev' and 'next->prev' are the same variable and we need in osq_lock()
129 WRITE_ONCE(prev->next, node); in osq_lock()
154 * Undo our @prev->next assignment; this will make @prev's in osq_lock()
155 * unlock()/unqueue() wait for a next pointer since @lock points to us in osq_lock()
164 if (data_race(prev->next) == node && in osq_lock()
165 cmpxchg(&prev->next, node, NULL) == node) in osq_lock()
186 * Step - B -- stabilize @next in osq_lock()
188 * Similar to unlock(), wait for @node->next or move @lock from @node in osq_lock()
192 next = osq_wait_next(lock, node, prev->cpu); in osq_lock()
193 if (!next) in osq_lock()
199 * @prev is stable because its still waiting for a new @prev->next in osq_lock()
200 * pointer, @next is stable because our @node->next pointer is NULL and in osq_lock()
204 WRITE_ONCE(next->prev, prev); in osq_lock()
205 WRITE_ONCE(prev->next, next); in osq_lock()
212 struct optimistic_spin_node *node, *next; in osq_unlock() local
225 next = xchg(&node->next, NULL); in osq_unlock()
226 if (next) { in osq_unlock()
227 WRITE_ONCE(next->locked, 1); in osq_unlock()
231 next = osq_wait_next(lock, node, OSQ_UNLOCKED_VAL); in osq_unlock()
232 if (next) in osq_unlock()
233 WRITE_ONCE(next->locked, 1); in osq_unlock()