Lines Matching defs:node
58 * In order to acquire the lock, the caller should declare a local node and
59 * pass a reference of the node to this function in addition to the lock.
61 * on this node->locked until the previous lock holder sets the node->locked
65 void mcs_spin_lock(struct mcs_spinlock **lock, struct mcs_spinlock *node)
69 /* Init node */
70 node->locked = 0;
71 node->next = NULL;
76 * observation of @node. And to provide the ACQUIRE ordering associated
79 prev = xchg(lock, node);
82 * Lock acquired, don't need to set node->locked to 1. Threads
83 * only spin on its own node->locked value for lock acquisition.
85 * and does not proceed to spin on its own node->locked, this
87 * audit lock status, then set node->locked value here.
91 WRITE_ONCE(prev->next, node);
94 arch_mcs_spin_lock_contended(&node->locked);
98 * Releases the lock. The caller should pass in the corresponding node that
102 void mcs_spin_unlock(struct mcs_spinlock **lock, struct mcs_spinlock *node)
104 struct mcs_spinlock *next = READ_ONCE(node->next);
110 if (likely(cmpxchg_release(lock, node, NULL) == node))
113 while (!(next = READ_ONCE(node->next)))