io_uring_reg..._max_workers(3)
π io_uring_reg..._max_workers β bestie edition
okay so the actual manual page is io_uring_reg..._max_workers(3) and it lives in the liburing Manual, and bestie, it is SO much more chill than it sounds. let's get into it π«Ά
β¨ NAME β¨
io_uring_register_iowq_max_workers β modify the maximum allowed async workers π§
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_register_iowq_max_workers(struct io_uring *ring,
unsigned int *values);
π DESCRIPTION π
okay so first thing's first: io_uring async workers? they come in two whole flavors, and you have to know the difference or nothing makes sense. no cap.
- Bounded β these workers have a bounded execution time. like, they know when they're gonna be done. examples of this are filesystem reads, which normally complete in a relatively short amount of time. and even if the disk is being a whole mess and failing? they're still bounded by a timeout operation that will abort them if it's exceeded. so they're on a leash. π₯
- Unbounded β work items here may take an indefinite amount of time to complete. examples include doing IO to sockets, pipes, or any other non-regular type of file. these ones are out here living their main character life with no end date in sight. π
so what are the defaults, you ask? bestie. by default, the amount of bounded IO workers is limited to how many SQ entries the ring was setup with, or 4 times the number of online CPUs in the system β whichever is smaller. and unbounded workers? those are only limited by the process task limit, as indicated by the rlimit RLIMIT_NPROC limit. that's it. that's the whole ceiling. π
this can be modified by calling io_uring_register_iowq_max_workers with ring set to the ring in question, and values pointing to an array of two values. the first element should contain the number of desired bounded workers, and the second element should contain the number of desired unbounded workers. π«
and listen β these are both maximum values. io_uring will not maintain a high count of idle workers, they are reaped when they are not necessary anymore. it's giving "we hire when we need you, we don't keep you on the payroll for vibes". β¨
π if called with both values set to 0, the existing values are returned.
π₯ RETURN VALUE π₯
returns 0 on success, with values containing the previous values for the settings. yay! π
on error, any of the following may be returned:
-EFAULTβ the kernel was unable to copy the memory pointer to byvaluesas it was invalid. the pointer said "trust me" and lied. π-EINVALβvalueswasNULLor the new values exceeded the maximum allowed value. nope, that's too much, absolutely not. π
π SEE ALSO π
that's the whole page bestie, go forth and register those workers, slay, periodt π¦π π
sign-off moment: this was liburing-2.2, dated March 13, 2022 β from the liburing Manual. mwah. πβπ
π¦ where this page comes from
- alpine 3.22: liburing-doc 2.9-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.23: liburing-doc 2.12-r0 Β· LGPL-2.1-or-later OR MIT
- 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
- centos-stream 10: liburing-devel 2.12-1.el10 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- debian bookworm: liburing-dev 2.3-3
- debian trixie: liburing-dev 2.9-1
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- nixpkgs unstable: liburing 2.14
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- ubuntu noble: liburing-dev 2.5-1build1
- ubuntu questing: liburing-dev 2.11-1
- 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) 2022 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