Movatterモバイル変換


[0]ホーム

URL:


man7.org > Linux >man-pages

Linux/UNIX system programming training


io_uring_queue_init_mem(3) — Linux manual page

NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |SEE ALSO |COLOPHON

io_uring_queue_init(3)       liburing Manualio_uring_queue_init(3)

NAME        top

       io_uring_queue_init - setup io_uring submission and completion       queues

SYNOPSIS        top

#include <liburing.h>int io_uring_queue_init(unsignedentries,struct io_uring *ring,unsignedflags);int io_uring_queue_init_params(unsignedentries,struct io_uring *ring,struct io_uring_params *params);int io_uring_queue_init_mem(unsignedentries,struct io_uring *ring,struct io_uring_params *params,void *buf, size_tbuf_size);

DESCRIPTION        top

       Theio_uring_queue_init(3) function executes theio_uring_setup(2)       system call to initialize the submission and completion queues in       the kernel with at leastentries entries in the submission queue       and then maps the resulting file descriptor to memory shared       between the application and the kernel.       By default, the CQ ring will have twice the number of entries as       specified byentries for the SQ ring. This is adequate for regular       file or storage workloads, but may be too small for networked       workloads. The SQ ring entries do not impose a limit on the number       of in-flight requests that the ring can support, it merely limits       the number that can be submitted to the kernel in one go (batch).       If the CQ ring overflows, e.g. more entries are generated than       fits in the ring before the application can reap them, then if the       kernel supportsIORING_FEAT_NODROPthe ring enters a CQ ring       overflow state. Otherwise it drops the CQEs and incrementscq.koverflow instruct io_uring with the number of CQEs dropped.       The overflow state is indicated byIORING_SQ_CQ_OVERFLOWbeing set       in the SQ ring flags. Unless the kernel runs out of available       memory, entries are not dropped, but it is a much slower       completion path and will slow down request processing. For that       reason it should be avoided and the CQ ring sized appropriately       for the workload. Settingcq_entries instruct io_uring_params       will tell the kernel to allocate this many entries for the CQ       ring, independent of the SQ ring size in given inentries.  If the       value isn't a power of 2, it will be rounded up to the nearest       power of 2.       On success,io_uring_queue_init(3) returns 0 andring will point       to the shared memory containing the io_uring queues. On failure-errnois returned.flags will be passed through to the io_uring_setup syscall (seeio_uring_setup(2)).       Theio_uring_queue_init_params(3) andio_uring_queue_init_mem(3)       variants will pass the parameters indicated byparams straight       through to theio_uring_setup(2) system call.       Theio_uring_queue_init_mem(3) variant uses the providedbuf with       associated sizebuf_size as the memory for the ring, using theIORING_SETUP_NO_MMAPflag toio_uring_setup(2).  The buffer passed       toio_uring_queue_init_mem(3) must be page size aligned on the       host, and must already be zeroed.  Typically, the caller should       allocate a huge page and pass that in toio_uring_queue_init_mem(3).  Pages allocated by mmap are already       zeroed.io_uring_queue_init_mem(3) returns the number of bytes       used from the provided buffer, so that the app can reuse the       buffer with the returned offset to put more rings in the same huge       page.       On success, the resources held byring should be released via a       corresponding call toio_uring_queue_exit(3).

RETURN VALUE        top

io_uring_queue_init(3) andio_uring_queue_init_params(3) return 0       on success and-errnoon failure.io_uring_queue_init_mem(3) returns the number of bytes used from       the provided buffer on success, and-errnoon failure.

SEE ALSO        top

io_uring_setup(2),io_uring_register_ring_fd(3),mmap(2),io_uring_queue_exit(3)

COLOPHON        top

       This page is part of theliburing (A library for io_uring)       project.  Information about the project can be found at        ⟨https://github.com/axboe/liburing⟩.  If you have a bug report for       this manual page, send it to io-uring@vger.kernel.org.  This page       was obtained from the project's upstream Git repository       ⟨https://github.com/axboe/liburing⟩ on 2025-08-11.  (At that time,       the date of the most recent commit that was found in the       repository was 2025-08-02.)  If you discover any rendering       problems in this HTML version of the page, or you believe there is       a better or more up-to-date source for the page, or you have       corrections or improvements to the information in this COLOPHON       (which isnot part of the original manual page), send a mail to       man-pages@man7.orgliburing-0.7                  July 10, 2020io_uring_queue_init(3)

Pages that refer to this page:io_uring_queue_init(3)io_uring_queue_init_mem(3)io_uring_queue_init_params(3)



HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface.

For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere.

Hosting byjambit GmbH.

Cover of TLPI


[8]ページ先頭

©2009-2025 Movatter.jp