- ret = io_uring_enter(s, to_submit, to_wait,
- IORING_ENTER_GETEVENTS);
- s->calls++;
+ /*
+ * Only need to call io_uring_enter if we're not using SQ thread
+ * poll, or if IORING_SQ_NEED_WAKEUP is set.
+ */
+ if (!sq_thread_poll || (*ring->flags & IORING_SQ_NEED_WAKEUP)) {
+ ret = io_uring_enter(s, to_submit, to_wait,
+ IORING_ENTER_GETEVENTS);
+ s->calls++;
+ }