| io_uring_resize_rings(3) | liburing Manual | io_uring_resize_rings(3) |
io_uring_resize_rings - resize the SQ and CQ rings
#include <liburing.h>
int io_uring_resize_rings(struct io_uring *ring,
struct io_uring_params *p);
The io_uring_resize_rings(3) function performs resizes the SQ and/or CQ ring associated with ring by the parameters specified in p .
The p argument must be filled in with the appropriate information for the resize operations, most notably the sq_entries and cq_entries fields must be filled out. The flags field can also be set, see below for potential values that may be used with a resize operation.
It's fairly uncommon to need to resize the SQ ring, but not that uncommon that the CQ ring would need resizing. For networked workloads, it can be hard to appropriately size the CQ ring upfront, as it's not always known what load a given ring will see. If overflow conditions are seen for the CQ ring, then resizing it larger may be a good idea.
When a ring is resized, any pending SQ or CQ entries are copied along the way. It is not legal to resize a CQ ring that is in an overflow condition, and attempting to do so will fail.
Currently doesn't support resizing rings setup with IORING_SETUP_NO_MMAP . This is purely a liburing limitation, the kernel does support it.
Also note that ring resizing is currently only supported on rings setup with IORING_SETUP_DEFER_TASKRUN . Attempting to resize differently configured rings will result in an -EINVAL error.
Valid flags in flags:
Other flags are inherited from the way the ring was setup, that includes flags like IORING_SETUP_NO_SQARRAY , IORING_SETUP_SQE128 , IORING_SETUP_CQE32 , and IORING_SETUP_NO_MMAP .
Other fields in p should be cleared to zero.
Available since kernel 6.13.
Also see io_uring_setup(2) for a detailed description of the setup flags.
Returns 0 on success, and < 0 on failure. Potential common failure cases:
| October 29, 2024 | liburing-2.9 |