io_uring_mlock_size_params(3)
π io_uring_mlock_size_params β bestie edition π
okay so this is io_uring_mlock_size_params from the liburing manual, and it's literally the glow-up version of a memlock-size checker. it's giving "tell me exactly how much memory i need before i do the thing." β¨
πΈ NAME πΈ
io_uring_mlock_size_params β get the required memlock size for a ring that has params, no cap π«Ά
β¨ SYNOPSIS β¨
#include <liburing.h>
ssize_t io_uring_mlock_size_params(unsigned entries, struct io_uring_params *p);
π DESCRIPTION π
so like. the io_uring_mlock_size_params(3) function hands you back the required RLIMIT_MEMLOCK memory size for an io_uring ring that has entries entries and the parameters you put in p. that's it, that's the whole vibe check. π
here's the plot twist tho: on the newer kernels (5.12+), io_uring doesn't need any memlock memory at all anymore, so this function will just return 0. iconic. but on the older kernels (5.11 and prior), it returns the required memory so you can make sure there's enough RLIMIT_MEMLOCK space available before you even set up a ring. lowkey essential for the old-kernel girlies. π
and the way this one is better than io_uring_mlock_size(3)? it gives you way more control, because you get to specify the full ring parameters, including the CQ size via p->cq_entries β but only when IORING_SETUP_CQSIZE is set in p->flags. periodt. π
π RETURN VALUE π
- on success β the required memlock size in bytes π
- if no memlock is needed β
0(slay) - on error β a negative errno value π
π¦ SEE ALSO π¦
and that's the whole page bestie, mwah π this one's from liburing-2.4, dated January 18, 2025, and yes the page is literally named io_uring_mlock_size_params(3) β go check your memlock, ily, bye πβ¨π«Ά
π¦ 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