io_uring_memory_size_params(3)
β¨ io_uring_memory_size_params β the "how much RAM do I need tho" oracle β¨
okay bestie, we're in the liburing manual, section 3, and today's main character is io_uring_memory_size_params. π
π NAME π
io_uring_memory_size_params β get the memory size needed for a ring, but with params this time π«Ά
πΈ SYNOPSIS πΈ
#include <liburing.h>
ssize_t io_uring_memory_size_params(unsigned entries, struct io_uring_params *p);
π¦ DESCRIPTION π¦
so like. the io_uring_memory_size_params(3) function tells you the total memory size needed for an io_uring ring β specifically a ring with entries entries plus whatever parameters you've shoved into p. no cap, that's the whole vibe. β¨
it's giving pre-allocation realness, because this is for the girlies whose applications either
- want to pre-allocate memory for a ring ahead of time, or
- just want to know the memory footprint before actually creating a ring π
now here's the tea: this function is lowkey more powerful than io_uring_memory_size(3), because it hands the caller full ring parameters. that means you can specify the CQ size via p->cq_entries β but only when IORING_SETUP_CQSIZE is set in p->flags. it's giving "control freak but make it a syscall" π
π RETURN VALUE π
- on success β returns the required memory size in bytes π
- on error β returns a negative
errnovalue π
and the one error we know about:
-EINVALβ theentriesvalue is invalid. that means it's either0, or it's too large and you didn't passIORING_SETUP_CLAMP. bestie, clamp it or fix it. π
π SEE ALSO π
io_uring_memory_size(3)io_uring_mlock_size_params(3)io_uring_queue_init_params(3)
okay that's the whole page, you ate that. this was brought to you by liburing-2.11, dated January 18, 2025 β periodt. π β¨
π¦ where this page comes from
- alpine 3.24: liburing-doc 2.14-r0 Β· LGPL-2.1-or-later OR MIT
- arch rolling: liburing 2.15-1 Β· GPL-2.0-only WITH Linux-syscall-note OR MIT AND LGPL-2.0-or-later AND MIT
- nixpkgs unstable: liburing 2.14
- ubuntu resolute: liburing-dev 2.14-1
- ubuntu stonking: liburing-dev 2.15-1
- π the page's license: LGPL-2.0-or-later
- Copyright (C) 2025 Jens Axboe <axboe@kernel.dk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms