io_uring_submit(3)
π io_uring_submit β bestie edition π
okay so real quick, this is a page from the liburing Manual and it's all about io_uring_submit(3), aka the moment you finally stop prepping and actually send your requests. let's get into it π«Ά
β¨ NAME β¨
io_uring_submit β submit requests to the submission queue. that's the whole job. that's the vibe. π
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_submit(struct io_uring *ring);
π¦ DESCRIPTION π¦
so like. io_uring_submit(3) submits the next events to the submission queue belonging to the ring. that's it, that's the function. π
the way it works is: you (the caller) grab a submission queue entry (SQE) with io_uring_get_sqe(3), then you prep that SQE using one of the provided helpers, and then you hit it with io_uring_submit(3). prep, prep, prep, submit. iconic pipeline honestly. β¨
π RETURN VALUE π
on success, io_uring_submit(3) returns the number of submitted submission queue entries β that's the case if SQPOLL is not used.
β οΈ now if SQPOLL is used, plot twist: the return value may report a higher number of submitted entries than were actually submitted. so it can lowkey lie to you. π
if you're using SQPOLL and you genuinely need accurate info about how many submission queue entries have been successfully submitted, you gotta fall back to repeatedly submitting a single submission queue entry. one at a time. no shortcuts. π
and on failure? it returns -errno. periodt.
π NOTES π
big one, bestie, listen up: for any request that passes in data in a struct, that data must remain valid until the request has been successfully submitted.
it does not need to remain valid until completion. once a request has been submitted, the in-kernel state is stable. π§
but VERY early kernels (5.4 and earlier) required state to be stable until the completion occurred. ancient behavior, we don't claim her. π
wanna know which one you're dealing with? applications can test for this behavior by inspecting the IORING_FEAT_SUBMIT_STABLE flag, which gets passed back from io_uring_queue_init_params(3). π
and in general, the man pages for the individual prep helpers will have a note mentioning this fact too, if it's required for the given command. so like, always check the helper's own page before you assume. iykyk. π
π SEE ALSO π
that's the whole page babes!! this one came from liburing-2.1, dated November 15, 2021 β go submit some requests, you absolute main character π«Άβ¨π
π¦ 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 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 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) 2021 Stefan Roesch <shr@fb.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms