Skip to content
Advertisement

How much locked memory does io_uring_setup need?

When using io_uring_queue_init it calls io_uring_setup. There’s an ENOMEM returned when there is insufficient amount of locked memory available for the process.

A strace will look something like:

JavaScript

What is the formula for how much locked memory is required per entry (first argument)? and if possible, based on the sq_entries/cq_entries in the params structure? Kernel code for the particularly keen. Please don’t expand the kernel page size from the formula, as I do want this to be an architecture dependent answer (if it is).

I don’t want a dodgy just set ulimit -l to unlimited as an answer. There’s this outstanding feature request feature request that would help when implemented.

Advertisement

Answer

Thanks to Jens Axboe the following to liburing library calls where added (>=liburing-2.1) returning the size in bytes, 0 if not required, or -errno for errors.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement