mirror of
https://github.com/openharmony/third_party_liburing.git
synced 2026-07-22 15:45:20 -04:00
sq_ring_needs_enter: revert change to only enter if submit != 0
This reverts commit c415b39d67.
Glauber reports a regressions for his polled setup with this change.
As it's purely speculative, just revert it.
Reported-by: Glauber Costa <glauber.costa@datadoghq.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
+4
-5
@@ -19,10 +19,9 @@
|
||||
* 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.
|
||||
*/
|
||||
static inline bool sq_ring_needs_enter(struct io_uring *ring,
|
||||
unsigned submitted, unsigned *flags)
|
||||
static inline bool sq_ring_needs_enter(struct io_uring *ring, unsigned *flags)
|
||||
{
|
||||
if (!(ring->flags & IORING_SETUP_SQPOLL) && submitted)
|
||||
if (!(ring->flags & IORING_SETUP_SQPOLL))
|
||||
return true;
|
||||
if (IO_URING_READ_ONCE(*ring->sq.kflags) & IORING_SQ_NEED_WAKEUP) {
|
||||
*flags |= IORING_ENTER_SQ_WAKEUP;
|
||||
@@ -90,7 +89,7 @@ int __io_uring_get_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_ptr,
|
||||
if (wait_nr || cq_overflow_flush)
|
||||
flags = IORING_ENTER_GETEVENTS;
|
||||
if (submit)
|
||||
sq_ring_needs_enter(ring, submit, &flags);
|
||||
sq_ring_needs_enter(ring, &flags);
|
||||
if (wait_nr || submit || cq_overflow_flush)
|
||||
ret = __sys_io_uring_enter(ring->ring_fd, submit,
|
||||
wait_nr, flags, sigmask);
|
||||
@@ -256,7 +255,7 @@ static int __io_uring_submit(struct io_uring *ring, unsigned submitted,
|
||||
int ret;
|
||||
|
||||
flags = 0;
|
||||
if (sq_ring_needs_enter(ring, submitted, &flags) || wait_nr) {
|
||||
if (sq_ring_needs_enter(ring, &flags) || wait_nr) {
|
||||
if (wait_nr || (ring->flags & IORING_SETUP_IOPOLL))
|
||||
flags |= IORING_ENTER_GETEVENTS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user