Lines Matching +full:21 +full:- +full:k
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Descending-priority-sorted double-linked list
5 * (C) 2002-2003 Intel Corp
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>.
8 * 2001-2005 (c) MontaVista Software, Inc.
14 * Oleg Nesterov <oleg@tv-sign.ru>
18 * This is a priority-sorted list of nodes; each node has a
21 * Addition is O(K), removal is O(1), change of priority of a node is
22 * O(K) and K is the number of RT priority levels used in the system.
23 * (1 <= K <= 99)
27 * - The tier 1 list is the prio_list, different priority nodes.
29 * - The tier 2 list is the node_list, serialized nodes.
37 * ||------------------------------------|
38 * ||->|pl|<->|pl|<--------------->|pl|<-|
39 * | |10| |21| |21| |21| |40| (prio)
42 * |->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-|
43 * |-------------------------------------------|
83 * PLIST_HEAD_INIT - static struct plist_head initializer
92 * PLIST_HEAD - declare and init plist_head
99 * PLIST_NODE_INIT - static struct plist_node initializer
111 * plist_head_init - dynamic struct plist_head initializer
117 INIT_LIST_HEAD(&head->node_list); in plist_head_init()
121 * plist_node_init - Dynamic struct plist_node initializer
127 node->prio = prio; in plist_node_init()
128 INIT_LIST_HEAD(&node->prio_list); in plist_node_init()
129 INIT_LIST_HEAD(&node->node_list); in plist_node_init()
138 * plist_for_each - iterate over the plist
143 list_for_each_entry(pos, &(head)->node_list, node_list)
146 * plist_for_each_continue - continue iteration over the plist
153 list_for_each_entry_continue(pos, &(head)->node_list, node_list)
156 * plist_for_each_safe - iterate safely over a plist of given type
164 list_for_each_entry_safe(pos, n, &(head)->node_list, node_list)
167 * plist_for_each_entry - iterate over list of given type
173 list_for_each_entry(pos, &(head)->node_list, mem.node_list)
176 * plist_for_each_entry_continue - continue iteration over list of given type
185 list_for_each_entry_continue(pos, &(head)->node_list, m.node_list)
188 * plist_for_each_entry_safe - iterate safely over list of given type
197 list_for_each_entry_safe(pos, n, &(head)->node_list, m.node_list)
200 * plist_head_empty - return !0 if a plist_head is empty
205 return list_empty(&head->node_list); in plist_head_empty()
209 * plist_node_empty - return !0 if plist_node is not on a list
214 return list_empty(&node->node_list); in plist_node_empty()
220 * plist_first_entry - get the struct for the first entry
237 * plist_last_entry - get the struct for the last entry
254 * plist_next - get the next entry in list
261 * plist_prev - get the prev entry in list
268 * plist_first - return the first node (and thus, highest priority)
275 return list_entry(head->node_list.next, in plist_first()
280 * plist_last - return the last node (and thus, lowest priority)
287 return list_entry(head->node_list.prev, in plist_last()