pespin has uploaded this change for review.

View Change

osmo_io: io_uring: Fix batch mode in multithread process

Change-Id: Ie7f3a3684a4b550c4e23fe82426ec2d384cc606f
---
M src/core/osmo_io_uring.c
1 file changed, 4 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/41841/1
diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index 0304375..3925f94 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -65,7 +65,6 @@
#define OSMO_IO_URING_READ_SQE "LIBOSMO_IO_URING_READ_SQE"

bool g_io_uring_batch = false;
-bool g_io_uring_submit_needed = false;

static int g_io_uring_size = IOFD_URING_INITIAL_SIZE;

@@ -76,6 +75,7 @@
struct io_uring ring;
struct llist_head cancel_queue;
unsigned int num_pending_submissions;
+ bool submit_needed;
};

static __thread struct osmo_io_uring *g_ring = NULL;
@@ -234,7 +234,7 @@
if (OSMO_LIKELY(!g_io_uring_batch))
io_uring_submit(&g_ring->ring);
else
- g_io_uring_submit_needed = true;
+ g_ring->submit_needed = true;
}

static inline int iofd_uring_submit_recv_sqe(struct osmo_io_fd *iofd, enum iofd_msg_action action)
@@ -806,9 +806,9 @@

void osmo_io_uring_submit(void)
{
- if (OSMO_LIKELY(g_io_uring_submit_needed)) {
+ if (OSMO_LIKELY(g_ring->submit_needed)) {
io_uring_submit(&g_ring->ring);
- g_io_uring_submit_needed = false;
+ g_ring->submit_needed = false;
}
}


To view, visit change 41841. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie7f3a3684a4b550c4e23fe82426ec2d384cc606f
Gerrit-Change-Number: 41841
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>