jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/40782?usp=email )
Change subject: Add environment variable to set io_uring size ......................................................................
Add environment variable to set io_uring size
The term "LIBOSMO_IO_URING_INITIAL_SIZE" is related to the following patch, which will increment the size of the io_uring automatically if the initial size is too small.
Related: OS#6705 Change-Id: I55289d9282e13aa1bf82f3931c85c196752f1484 --- M src/core/osmo_io_uring.c 1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/40782/1
diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c index a9fd441..1817779 100644 --- a/src/core/osmo_io_uring.c +++ b/src/core/osmo_io_uring.c @@ -52,15 +52,19 @@
#include "osmo_io_internal.h"
-#define IOFD_URING_ENTRIES 4096 +#define IOFD_URING_INITIAL_SIZE 4096
#define OSMO_IO_URING_BATCH "LIBOSMO_IO_URING_BATCH"
+#define OSMO_IO_URING_INITIAL_SIZE "LIBOSMO_IO_URING_INITIAL_SIZE" + #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; + static int g_io_uring_read_sqes = 1;
struct osmo_io_uring { @@ -103,7 +107,10 @@ if ((env = getenv(OSMO_IO_URING_BATCH))) g_io_uring_batch = true;
- rc = io_uring_queue_init(IOFD_URING_ENTRIES, &g_ring.ring, 0); + if ((env = getenv(OSMO_IO_URING_INITIAL_SIZE))) + g_io_uring_size = atoi(env); + + rc = io_uring_queue_init(g_io_uring_size, &g_ring.ring, 0); if (rc < 0) osmo_panic("failure during io_uring_queue_init(): %s\n", strerror(-rc));