MCPcopy Create free account
hub / github.com/axboe/liburing / sq_ring_needs_enter

Function sq_ring_needs_enter

src/queue.c:17–40  ·  view source on GitHub ↗

* Returns true if we're not using SQ thread (thus nobody submits but us) * or if IORING_SQ_NEED_WAKEUP is set, so submit thread must be explicitly * awakened. For the latter case, we set the thread wakeup flag. * If no SQEs are ready for submission, returns false. */

Source from the content-addressed store, hash-verified

15 * If no SQEs are ready for submission, returns false.
16 */
17static inline bool sq_ring_needs_enter(struct io_uring *ring,
18 unsigned submit,
19 unsigned *flags)
20{
21 if (!submit)
22 return false;
23
24 if (!(ring->flags & IORING_SETUP_SQPOLL))
25 return true;
26
27 /*
28 * Ensure the kernel can see the store to the SQ tail before we read
29 * the flags.
30 */
31 io_uring_smp_mb();
32
33 if (uring_unlikely(IO_URING_READ_ONCE(*ring->sq.kflags) &
34 IORING_SQ_NEED_WAKEUP)) {
35 *flags |= IORING_ENTER_SQ_WAKEUP;
36 return true;
37 }
38
39 return false;
40}
41
42static inline bool cq_ring_needs_flush(struct io_uring *ring)
43{

Callers 2

_io_uring_get_cqeFunction · 0.85
__io_uring_submitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected