Lines Matching full:oldest

23 	 * queue->newest and queue->oldest are never null.  in vdo_make_funnel_queue()
27 queue->oldest = &queue->stub; in vdo_make_funnel_queue()
45 struct funnel_queue_entry *oldest = queue->oldest; in get_oldest() local
46 struct funnel_queue_entry *next = READ_ONCE(oldest->next); in get_oldest()
48 if (oldest == &queue->stub) { in get_oldest()
50 * When the oldest entry is the stub and it has no successor, the queue is in get_oldest()
59 oldest = next; in get_oldest()
60 queue->oldest = oldest; in get_oldest()
61 next = READ_ONCE(oldest->next); in get_oldest()
71 if (oldest != newest) { in get_oldest()
86 next = READ_ONCE(oldest->next); in get_oldest()
96 return oldest; in get_oldest()
100 * Poll a queue, removing the oldest entry if the queue is not empty. This function must only be
105 struct funnel_queue_entry *oldest = get_oldest(queue); in vdo_funnel_queue_poll() local
107 if (oldest == NULL) in vdo_funnel_queue_poll()
108 return oldest; in vdo_funnel_queue_poll()
111 * Dequeue the oldest entry and return it. Only one consumer thread may call this function, in vdo_funnel_queue_poll()
112 * so no locking, atomic operations, or fences are needed; queue->oldest is owned by the in vdo_funnel_queue_poll()
113 * consumer and oldest->next is never used by a producer thread after it is swung from NULL in vdo_funnel_queue_poll()
116 queue->oldest = READ_ONCE(oldest->next); in vdo_funnel_queue_poll()
119 * fetched the entry pointer we stored in "queue->oldest", this also ensures that on entry in vdo_funnel_queue_poll()
124 * If "oldest" is a very light-weight work item, we'll be looking for the next one very in vdo_funnel_queue_poll()
127 uds_prefetch_address(queue->oldest, true); in vdo_funnel_queue_poll()
128 WRITE_ONCE(oldest->next, NULL); in vdo_funnel_queue_poll()
129 return oldest; in vdo_funnel_queue_poll()
151 * Oldest is not the stub, so there's another entry, though if next is NULL we can't in vdo_is_funnel_queue_idle()
154 if (queue->oldest != &queue->stub) in vdo_is_funnel_queue_idle()
158 * Oldest is the stub, but newest has been updated by _put(); either there's another, in vdo_is_funnel_queue_idle()