Lines Matching +full:lock +full:- +full:less
1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Lock-less NULL terminated single linked list
15 * llist_del_first or llist_del_all used in other consumers, then a lock is
16 * needed. This is because llist_del_first depends on list->first->next not
17 * changing, but without lock protection, there's no way to be sure about that
19 * preempted back, the list->first is the same as before causing the cmpxchg in
28 * add | - | - | -
30 * del_all | | | -
33 * operation, with "-" being no lock needed, while "L" being lock is needed.
43 * architectures that don't have NMI-safe cmpxchg implementation, the
68 * init_llist_head - initialize lock-less list head
69 * @head: the head for your lock-less list
73 list->first = NULL; in init_llist_head()
77 * init_llist_node - initialize lock-less list node
86 node->next = node; in init_llist_node()
90 * llist_on_list - test if a lock-list list node is on a list
93 * When a node is on a list the ->next pointer will be NULL or
100 return node->next != node; in llist_on_list()
104 * llist_entry - get the struct of this entry
113 * member_address_is_nonnull - check whether the member address is not NULL
118 * &ptr->member != NULL
130 * llist_for_each - iterate over some deleted entries of a lock-less list
134 * In general, some entries of the lock-less list can be traversed
138 * If being used on entries deleted from lock-less list directly, the
144 for ((pos) = (node); pos; (pos) = (pos)->next)
147 * llist_for_each_safe - iterate over some deleted entries of a lock-less list
153 * In general, some entries of the lock-less list can be traversed
157 * If being used on entries deleted from lock-less list directly, the
163 for ((pos) = (node); (pos) && ((n) = (pos)->next, true); (pos) = (n))
166 * llist_for_each_entry - iterate over some deleted entries of lock-less list of given type
171 * In general, some entries of the lock-less list can be traversed
175 * If being used on entries deleted from lock-less list directly, the
183 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
186 * llist_for_each_entry_safe - iterate over some deleted entries of lock-less list of given type
193 * In general, some entries of the lock-less list can be traversed
197 * If being used on entries deleted from lock-less list directly, the
205 (n = llist_entry(pos->member.next, typeof(*n), member), true); \
209 * llist_empty - tests whether a lock-less list is empty
218 return READ_ONCE(head->first) == NULL; in llist_empty()
223 return node->next; in llist_next()
234 new_last->next = head->first; in __llist_add_batch()
235 head->first = new_first; in __llist_add_batch()
236 return new_last->next == NULL; in __llist_add_batch()
240 * llist_add - add a new entry
242 * @head: the head for your lock-less list
257 * llist_del_all - delete all entries from lock-less list
258 * @head: the head of lock-less list to delete all entries
266 return xchg(&head->first, NULL); in llist_del_all()
271 struct llist_node *first = head->first; in __llist_del_all()
273 head->first = NULL; in __llist_del_all()
280 * llist_del_first_init - delete first entry from lock-list and mark is as being off-list
281 * @head: the head of lock-less list to delete from.