| Modifier and Type | Field and Description
|
|---|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int | IORING_ENTER_EXT_ARGio_uring_enter(2) flags
Enum values:
ENTER_GETEVENTS -
If this flag is set, then the system call will wait for the specificied number of events in min_complete before returning.
This flag can be set along with to_submit to both submit and complete events in a single system call.
ENTER_SQ_WAKEUP - If the ring has been created with SETUP_SQPOLL, then this flag asks the kernel to wakeup the SQ kernel thread to submit IO.
ENTER_SQ_WAIT -
If the ring has been created with SETUP_SQPOLL, then the application has no real insight into when the SQ kernel thread has consumed entries from
the SQ ring. This can lead to a situation where the application can no longer get a free SQE entry to submit, without knowing when it one becomes
available as the SQ kernel thread consumes them. If the system call is used with this flag set, then it will wait until at least one entry is free
in the SQ ring.
ENTER_EXT_ARG -
Since kernel 5.11, the system calls arguments have been modified to look like the following:
int io_uring_enter(unsigned int fd, unsigned int to_submit,
unsigned int min_complete, unsigned int flags,
const void *arg, size_t argsz);
|
| public static final int | IORING_ENTER_GETEVENTSio_uring_enter(2) flags
Enum values:
ENTER_GETEVENTS -
If this flag is set, then the system call will wait for the specificied number of events in min_complete before returning.
This flag can be set along with to_submit to both submit and complete events in a single system call.
ENTER_SQ_WAKEUP - If the ring has been created with SETUP_SQPOLL, then this flag asks the kernel to wakeup the SQ kernel thread to submit IO.
ENTER_SQ_WAIT -
If the ring has been created with SETUP_SQPOLL, then the application has no real insight into when the SQ kernel thread has consumed entries from
the SQ ring. This can lead to a situation where the application can no longer get a free SQE entry to submit, without knowing when it one becomes
available as the SQ kernel thread consumes them. If the system call is used with this flag set, then it will wait until at least one entry is free
in the SQ ring.
ENTER_EXT_ARG -
Since kernel 5.11, the system calls arguments have been modified to look like the following:
int io_uring_enter(unsigned int fd, unsigned int to_submit,
unsigned int min_complete, unsigned int flags,
const void *arg, size_t argsz);
|
| public static final int | IORING_ENTER_REGISTERED_RINGio_uring_enter(2) flags
Enum values:
ENTER_GETEVENTS -
If this flag is set, then the system call will wait for the specificied number of events in min_complete before returning.
This flag can be set along with to_submit to both submit and complete events in a single system call.
ENTER_SQ_WAKEUP - If the ring has been created with SETUP_SQPOLL, then this flag asks the kernel to wakeup the SQ kernel thread to submit IO.
ENTER_SQ_WAIT -
If the ring has been created with SETUP_SQPOLL, then the application has no real insight into when the SQ kernel thread has consumed entries from
the SQ ring. This can lead to a situation where the application can no longer get a free SQE entry to submit, without knowing when it one becomes
available as the SQ kernel thread consumes them. If the system call is used with this flag set, then it will wait until at least one entry is free
in the SQ ring.
ENTER_EXT_ARG -
Since kernel 5.11, the system calls arguments have been modified to look like the following:
int io_uring_enter(unsigned int fd, unsigned int to_submit,
unsigned int min_complete, unsigned int flags,
const void *arg, size_t argsz);
|
| public static final int | IORING_ENTER_SQ_WAITio_uring_enter(2) flags
Enum values:
ENTER_GETEVENTS -
If this flag is set, then the system call will wait for the specificied number of events in min_complete before returning.
This flag can be set along with to_submit to both submit and complete events in a single system call.
ENTER_SQ_WAKEUP - If the ring has been created with SETUP_SQPOLL, then this flag asks the kernel to wakeup the SQ kernel thread to submit IO.
ENTER_SQ_WAIT -
If the ring has been created with SETUP_SQPOLL, then the application has no real insight into when the SQ kernel thread has consumed entries from
the SQ ring. This can lead to a situation where the application can no longer get a free SQE entry to submit, without knowing when it one becomes
available as the SQ kernel thread consumes them. If the system call is used with this flag set, then it will wait until at least one entry is free
in the SQ ring.
ENTER_EXT_ARG -
Since kernel 5.11, the system calls arguments have been modified to look like the following:
int io_uring_enter(unsigned int fd, unsigned int to_submit,
unsigned int min_complete, unsigned int flags,
const void *arg, size_t argsz);
|
| public static final int | IORING_ENTER_SQ_WAKEUPio_uring_enter(2) flags
Enum values:
ENTER_GETEVENTS -
If this flag is set, then the system call will wait for the specificied number of events in min_complete before returning.
This flag can be set along with to_submit to both submit and complete events in a single system call.
ENTER_SQ_WAKEUP - If the ring has been created with SETUP_SQPOLL, then this flag asks the kernel to wakeup the SQ kernel thread to submit IO.
ENTER_SQ_WAIT -
If the ring has been created with SETUP_SQPOLL, then the application has no real insight into when the SQ kernel thread has consumed entries from
the SQ ring. This can lead to a situation where the application can no longer get a free SQE entry to submit, without knowing when it one becomes
available as the SQ kernel thread consumes them. If the system call is used with this flag set, then it will wait until at least one entry is free
in the SQ ring.
ENTER_EXT_ARG -
Since kernel 5.11, the system calls arguments have been modified to look like the following:
int io_uring_enter(unsigned int fd, unsigned int to_submit,
unsigned int min_complete, unsigned int flags,
const void *arg, size_t argsz);
|
| public static final int | IORING_FEAT_CQE_SKIPio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_CUR_PERSONALITYio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_EXT_ARGio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_FAST_POLLio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_LINKED_FILEio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_NATIVE_WORKERSio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_NODROPio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_POLL_32BITSio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_REG_REG_RINGio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_RSRC_TAGSio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_RW_CUR_POSio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_SINGLE_MMAPio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_SQPOLL_NONFIXEDio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FEAT_SUBMIT_STABLEio_uring_params->features flags
Enum values:
FEAT_SINGLE_MMAP -
If this flag is set, the two SQ and CQ rings can be mapped with a single mmap(2) call.
The SQEs must still be allocated separately. This brings the necessary mmap(2) calls down from three to two.
Available since kernel 5.4.
FEAT_NODROP -
If this flag is set, io_uring supports never dropping completion events.
If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more
entries. If this overflow condition is entered, attempting to submit more IO will fail with the -EBUSY error value, if it can't flush the
overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the submit again.
Available since kernel 5.5.
FEAT_SUBMIT_STABLE -
If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.
Available since kernel 5.5.
FEAT_RW_CUR_POS -
If this flag is set, applications can specify offset == -1 with IORING_OP_{READV,WRITEV}, IORING_OP_{READ,WRITE}_FIXED, and
IORING_OP_{READ,WRITE} to mean current file position, which behaves like preadv2(2) and pwritev2(2) with
offset == -1.
It'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple reads or writes in
flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file
position.
Available since kernel 5.6.
FEAT_CUR_PERSONALITY -
If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that
called enter to queue the requests.
If this flag isn't set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task
is using a ring, then this flag doesn't matter as the credentials will always be the same. Note that this is the default behavior, tasks can still
register different personalities through register with REGISTER_PERSONALITY and specify the personality to use in the sqe.
Available since kernel 5.6.
FEAT_FAST_POLL -
If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness.
This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will
begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is
set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread.
Available since kernel 5.7.
FEAT_POLL_32BITS -
If this flag is set, the OP_POLL_ADD command accepts the full 32-bit range of epoll based flags.
Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior.
Available since kernel 5.9.
FEAT_SQPOLL_NONFIXED -
If this flag is set, the SETUP_SQPOLL feature no longer requires the use of fixed files.
Any normal file descriptor can be used for IO commands without needing registration.
Available since kernel 5.11.
FEAT_EXT_ARG -
If this flag is set, then the enter system call supports passing in an extended argument instead of just the sigset_t of earlier
kernels.
This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout
argument for waiting on events. A pointer to this struct must be passed in if ENTER_EXT_ARG is set in the flags for the enter system call.
Available since kernel 5.11.
FEAT_NATIVE_WORKERS -
If this flag is set, io_uring is using native workers for its async helpers.
Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create
what looks more like regular process threads instead.
Available since kernel 5.12.
FEAT_RSRC_TAGS -
If this flag is set, then io_uring supports a variety of features related to fixed files and buffers.
In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first.
Available since kernel 5.13.
FEAT_CQE_SKIP -
If this flag is set, then io_uring supports setting IOSQE_CQE_SKIP_SUCCESS in the submitted SQE, indicating that no CQE should be generated for
this SQE if it executes normally. If an error happens processing the SQE, a CQE with the appropriate error value will still be generated.
Available since kernel 5.17.
FEAT_LINKED_FILE -
If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted
with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known
index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set,
then the kernel will defer file assignment until execution of a given request is started.
Available since kernel 5.17.
FEAT_REG_REG_RING
|
| public static final int | IORING_FILE_INDEX_ALLOCIf sqe->file_index is set to this for opcodes that instantiate a new direct descriptor (like openat/openat2/accept), then io_uring will
allocate an available direct descriptor instead of having the application pass one in.
The picked direct descriptor will be returned in cqe->res, or -ENFILE if the space is full.
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final long |
|
| public static final long |
|
| public static final long |
|
| public static final long |
|
| public static final long |
|
| public static final long |
|
| public static final byte | IORING_OP_ACCEPTio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_ASYNC_CANCELio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_CLOSEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_CONNECTio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_EPOLL_CTLio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FADVISEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FALLOCATEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FGETXATTRio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FILES_UPDATEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FSETXATTRio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_FSYNCio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_GETXATTRio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_LASTio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_LINK_TIMEOUTio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_LINKATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_MADVISEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_MKDIRATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_MSG_RINGio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_NOPio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_OPENATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_OPENAT2io_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_POLL_ADDio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_POLL_REMOVEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_PROVIDE_BUFFERSio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_READio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_READ_FIXEDio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_READVio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_RECVio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_RECVMSGio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_REMOVE_BUFFERSio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_RENAMEATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SENDio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SEND_ZCio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SENDMSGio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SENDMSG_ZCio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SETXATTRio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SHUTDOWNio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SOCKETio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SPLICEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_STATXio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SYMLINKATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_SYNC_FILE_RANGEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_TEEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_TIMEOUTio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_TIMEOUT_REMOVEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_UNLINKATio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_URING_CMDio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_WRITEio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_WRITE_FIXEDio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final byte | IORING_OP_WRITEVio_uring_op
Enum values:
OP_NOP - Do not perform any I/O. This is useful for testing the performance of the io_uring implementation itself.
OP_READV - Vectored read operation, similar to preadv2(2). If the file is not seekable, off must be set to zero.
OP_WRITEV - Vectored write operation, similar to pwritev2(2). If the file is not seekable, off must be set to zero.
OP_FSYNC -
File sync. See also fsync(2).
Note that, while I/O is initiated in the order in which it appears inthe submission queue, completions are unordered. For example, an application
which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in
parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not
completed prior to the fsync.
OP_READ_FIXED - Read from pre-mapped buffers. See register for details on how to setup a context for fixed reads.
OP_WRITE_FIXED - Write to pre-mapped buffers. See register for details on how to setup a context for fixed writes.
OP_POLL_ADD -
Poll the fd specified in the submission queue entry for the events specified in the poll_events field.
Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is
completed, it will have to be resubmitted.
If POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when
the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have CQE_F_MORE
set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the
poll request has been terminated and no further events will be generated. This mode is available since 5.13.
If POLL_UPDATE_EVENTS is set in the SQE len field, then the request will update an existing poll request with the mask of events passed in
with this request. The lookup is based on the user_data field of the original SQE submitted, and this values is passed in the addr
field of the SQE. This mode is available since 5.13.
If POLL_UPDATE_USER_DATA is set in the SQE len field, then the request will update the user_data of an existing poll request based
on the value passed in the off field. This mode is available since 5.13.
This command works like an asyncpoll(2) and the completion event result is the returned mask of events. For the variants that update
user_data or events, the completion result will be similar to OP_POLL_REMOVE.
OP_POLL_REMOVE -
Remove an existing poll request.
If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or
-EALREADY if the poll request was in the process of completing already.
OP_SYNC_FILE_RANGE -
Issue the equivalent of a sync_file_range(2) on the file descriptor.
The fd field is the file descriptor to sync, the off field holds the offset in bytes, the len field holds the length in
bytes, and the sync_range_flags field holds the flags for the command. See also sync_file_range(2) for the general description of
the related system call.
Available since 5.2.
OP_SENDMSG -
Issue the equivalent of a sendmsg(2) system call.
fd must be set to the socket file descriptor, addr must contain a pointer to the msghdr structure, and msg_flags
holds the flags associated with the system call. See also sendmsg(2) for the general description of the related system call.
Available since 5.3.
OP_RECVMSG -
Works just like OP_SENDMSG, except for recvmsg(2) instead. See the description of IORING_OP_SENDMSG.
Available since 5.3.
OP_TIMEOUT -
This command will register a timeout operation.
The addr field must contain a pointer to a struct timespec64 structure, len must contain 1 to signify one
timespec64 structure, timeout_flags may contain TIMEOUT_ABS for an absolute timeout value, or 0 for a relative timeout.
off may contain a completion event count. A timeout will trigger a wakeup event on the completion ring for anyone waiting for events. A
timeout condition is met when either the specified timeout expires, or the specified number of events have completed. Either condition will trigger
the event. If set to 0, completed events are not counted, which effectively acts like a timer. io_uring timeouts use the
CLOCK_MONOTONIC clock source. The request will complete with -ETIME if the timeout got completed through expiration of the timer,
or 0 if the timeout got completed through requests completing on their own. If the timeout was cancelled before it expired, the request will
complete with -ECANCELED.
Available since 5.4.
Since 5.15, this command also supports the following modifiers in timeout_flags:
TIMEOUT_BOOTTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. This clock source differs
in that it includes time elapsed if the system was suspend while having a timeout request in-flight.
TIMEOUT_REALTIME: If set, then the clock source used is CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int | IORING_RECV_MULTISHOTsend/sendmsg and recv/recvmsg flags (sqe->ioprio)
Enum values:
RECVSEND_POLL_FIRST -
If set, io_uring will assume the socket is currently empty and attempting to receive data will be unsuccessful.
For this case, io_uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt
can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to
arming poll. If poll does indicate that data is ready to be received, the operation will proceed.
Can be used with the CQE CQE_F_SOCK_NONEMPTY flag, which io_uring will set on CQEs after a recv(2) or recvmsg(2) operation. If
set, the socket still had data to be read after the operation completed.
Both these flags are available since 5.19.
RECV_MULTISHOT -
Multishot recv.
Sets CQE_F_MORE if the handler will continue to report CQEs on behalf of the same SQE.
RECVSEND_FIXED_BUF - Use registered buffers, the index is stored in the buf_index field.
SEND_ZC_REPORT_USAGE
|
| public static final int | IORING_RECVSEND_FIXED_BUFsend/sendmsg and recv/recvmsg flags (sqe->ioprio)
Enum values:
RECVSEND_POLL_FIRST -
If set, io_uring will assume the socket is currently empty and attempting to receive data will be unsuccessful.
For this case, io_uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt
can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to
arming poll. If poll does indicate that data is ready to be received, the operation will proceed.
Can be used with the CQE CQE_F_SOCK_NONEMPTY flag, which io_uring will set on CQEs after a recv(2) or recvmsg(2) operation. If
set, the socket still had data to be read after the operation completed.
Both these flags are available since 5.19.
RECV_MULTISHOT -
Multishot recv.
Sets CQE_F_MORE if the handler will continue to report CQEs on behalf of the same SQE.
RECVSEND_FIXED_BUF - Use registered buffers, the index is stored in the buf_index field.
SEND_ZC_REPORT_USAGE
|
| public static final int | IORING_RECVSEND_POLL_FIRSTsend/sendmsg and recv/recvmsg flags (sqe->ioprio)
Enum values:
RECVSEND_POLL_FIRST -
If set, io_uring will assume the socket is currently empty and attempting to receive data will be unsuccessful.
For this case, io_uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt
can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to
arming poll. If poll does indicate that data is ready to be received, the operation will proceed.
Can be used with the CQE CQE_F_SOCK_NONEMPTY flag, which io_uring will set on CQEs after a recv(2) or recvmsg(2) operation. If
set, the socket still had data to be read after the operation completed.
Both these flags are available since 5.19.
RECV_MULTISHOT -
Multishot recv.
Sets CQE_F_MORE if the handler will continue to report CQEs on behalf of the same SQE.
RECVSEND_FIXED_BUF - Use registered buffers, the index is stored in the buf_index field.
SEND_ZC_REPORT_USAGE
|
| public static final int | IORING_REGISTER_BUFFERSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_BUFFERS2register opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_BUFFERS_UPDATEregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_ENABLE_RINGSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_EVENTFDregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_EVENTFD_ASYNCregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_FILE_ALLOC_RANGEregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_FILESregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_FILES2register opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int |
|
| public static final int | IORING_REGISTER_FILES_UPDATEregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_FILES_UPDATE2register opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_IOWQ_AFFregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_IOWQ_MAX_WORKERSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_LASTregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_PBUF_RINGregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_PERSONALITYregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_PROBEregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_RESTRICTIONSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_RING_FDSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_SYNC_CANCELregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_REGISTER_USE_REGISTERED_RINGregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int | IORING_SEND_ZC_REPORT_USAGEsend/sendmsg and recv/recvmsg flags (sqe->ioprio)
Enum values:
RECVSEND_POLL_FIRST -
If set, io_uring will assume the socket is currently empty and attempting to receive data will be unsuccessful.
For this case, io_uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt
can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to
arming poll. If poll does indicate that data is ready to be received, the operation will proceed.
Can be used with the CQE CQE_F_SOCK_NONEMPTY flag, which io_uring will set on CQEs after a recv(2) or recvmsg(2) operation. If
set, the socket still had data to be read after the operation completed.
Both these flags are available since 5.19.
RECV_MULTISHOT -
Multishot recv.
Sets CQE_F_MORE if the handler will continue to report CQEs on behalf of the same SQE.
RECVSEND_FIXED_BUF - Use registered buffers, the index is stored in the buf_index field.
SEND_ZC_REPORT_USAGE
|
| public static final int | IORING_SETUP_ATTACH_WQio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_CLAMPio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_COOP_TASKRUNio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_CQE32io_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_CQSIZEio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_DEFER_TASKRUNio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_IOPOLLio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_R_DISABLEDio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_SINGLE_ISSUERio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_SQ_AFFio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_SQE128io_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_SQPOLLio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_SUBMIT_ALLio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int | IORING_SETUP_TASKRUN_FLAGio_uring_setup() flags
Enum values:
SETUP_IOPOLL -
Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronous IRQ (Interrupt Request).
The file system (if any) and block device must support polling in order for this to work. Busy-waiting provides lower latency, but may consume more
CPU resources than interrupt driven I/O. Currently, this feature is usable only on a file descriptor opened using the O_DIRECT flag. When a
read or write is submitted to a polled context, the application must poll for completions on the CQ ring by calling enter. It is illegal to mix
and match polled and non-polled I/O on an io_uring instance.
SETUP_SQPOLL -
When this flag is specified, a kernel thread is created to perform submission queue polling.
An io_uring instance configured in this way enables an application to issue I/O without ever context switching into the kernel. By using
the submission queue to fill in new submission queue entries and watching for completions on the completion queue, the application can submit and
reap I/Os without doing a single system call.
If the kernel thread is idle for more than sq_thread_idle milliseconds, it will set the SQ_NEED_WAKEUP bit in the flags field of the
struct io_sq_ring. When this happens, the application must call enter to wake the kernel thread. If I/O is kept busy, the kernel thread
will never sleep. An application making use of this feature will need to guard the io_uring_enter() call with the following code sequence:
// Ensure that the wakeup flag is read after the tail pointer
// has been written. It's important to use memory load acquire
// semantics for the flags read, as otherwise the application
// and the kernel might not agree on the consistency of the
// wakeup flag.
unsigned flags = atomic_load_relaxed(sq_ring->flags);
if (flags & IORING_SQ_NEED_WAKEUP)
io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int |
|
| public static final int | IORING_UNREGISTER_BUFFERSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_EVENTFDregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_FILESregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_IOWQ_AFFregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_PBUF_RINGregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_PERSONALITYregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int | IORING_UNREGISTER_RING_FDSregister opcodes and arguments
Enum values:
REGISTER_BUFFERS -
arg points to a struct iovec array of nr_args entries.
The buffers associated with the iovecs will be locked in memory and charged against the user's RLIMIT_MEMLOCK resource limit.
See getrlimit(2) for more information. Additionally, there is a size limit of 1GiB per buffer. Currently, the buffers must be anonymous,
non-file-backed memory, such as that returned by malloc(3) or mmap(2) with the MAP_ANONYMOUS flag set. It is expected that
this limitation will be lifted in the future. Huge pages are supported as well. Note that the entire huge page will be pinned in the kernel, even
if only a portion of it is used.
After a successful call, the supplied buffers are mapped into the kernel and eligible for I/O. To make use of them, the application must specify
the OP_READ_FIXED or OP_WRITE_FIXED opcodes in the submission queue entry (see the struct io_uring_sqe definition in enter),
and set the buf_index field to the desired buffer index. The memory range described by the submission queue entry's addr and
len fields must fall within the indexed buffer.
It is perfectly valid to setup a large buffer and then only use part of it for an I/O, as long as the range is within the originally mapped region.
An application can increase or decrease the size or number of registered buffers by first unregistering the existing buffers, and then issuing a
new call to io_uring_register() with the new buffers.
Note that before 5.13 registering buffers would wait for the ring to idle. If the application currently has requests in-flight, the registration
will wait for those to finish before proceeding.
An application need not unregister buffers explicitly before shutting down the io_uring instance.
Available since 5.1.
UNREGISTER_BUFFERS -
This operation takes no argument, and arg must be passed as NULL.
All previously registered buffers associated with the io_uring instance will be released.
Available since 5.1.
REGISTER_FILES -
Register files for I/O.
arg contains a pointer to an array of nr_args file descriptors (signed 32 bit integers). To make use of the registered files, the
IOSQE_FIXED_FILE flag must be set in the flags member of the struct io_uring_sqe, and the fd member is set to the index of
the file in the file descriptor array.
The file set may be sparse, meaning that the fd field in the array may be set to -1. See REGISTER_FILES_UPDATE for how to update files in
place.
Note that before 5.13 registering files would wait for the ring to idle. If the application currently has requests in-flight, the registration will
wait for those to finish before proceeding. See REGISTER_FILES_UPDATE for how to update an existing set without that limitation.
Files are automatically unregistered when the io_uring instance is torn down. An application needs only unregister if it wishes to register a new
set of fds.
Available since 5.1.
UNREGISTER_FILES -
This operation requires no argument, and arg must be passed as NULL.
All previously registered files associated with the io_uring instance will be unregistered.
Available since 5.1.
REGISTER_EVENTFD -
It's possible to use eventfd(2) to get notified of completion events on an io_uring instance. If this is desired, an eventfd file
descriptor can be registered through this operation.
arg must contain a pointer to the eventfd file descriptor, and nr_args must be 1.
Available since 5.2.
An application can temporarily disable notifications, coming through the registered eventfd, by setting the CQ_EVENTFD_DISABLED bit in the
flags field of the CQ ring.
Available since 5.8.
UNREGISTER_EVENTFD -
Unregister an eventfd file descriptor to stop notifications.
Since only one eventfd descriptor is currently supported, this operation takes no argument, and arg must be passed as NULL and
nr_args must be zero.
Available since 5.2.
REGISTER_FILES_UPDATE -
This operation replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is equal to
-1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_files_update, which contains an offset on which to start the update, and an array
of file descriptors to use for the update. nr_args must contain the number of descriptors in the passed in array.
Available since 5.5.
File descriptors can be skipped if they are set to REGISTER_FILES_SKIP. Skipping an fd will not touch the file associated with the previous fd at
that index.
Available since 5.12.
REGISTER_EVENTFD_ASYNC -
This works just like REGISTER_EVENTFD, except notifications are only posted for events that complete in an async manner.
This means that events that complete inline while being submitted do not trigger a notification event. The arguments supplied are the same as for
IORING_REGISTER_EVENTFD.
Available since 5.6.
REGISTER_PROBE -
This operation returns a structure, io_uring_probe, which contains information about the opcodes supported by io_uring on
the running kernel.
arg must contain a pointer to a struct io_uring_probe, and nr_args must contain the size of the ops array in that probe
struct. The ops array is of the type io_uring_probe_op, which holds the value of the opcode and a flags field. If
the flags field has IO_URING_OP_SUPPORTED set, then this opcode is supported on the running kernel.
Available since 5.6.
REGISTER_PERSONALITY -
This operation registers credentials of the running application with io_uring, and returns an id associated with these credentials.
Applications wishing to share a ring between separate users/processes can pass in this credential id in the sqe personality field. If set, that
particular sqe will be issued with these credentials. Must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.6.
UNREGISTER_PERSONALITY -
This operation unregisters a previously registered personality with io_uring.
nr_args must be set to the id in question, and arg must be set to NULL.
Available since 5.6.
REGISTER_RESTRICTIONS -
arg points to a struct io_uring_restriction array of nr_args entries.
With an entry it is possible to allow an register opcode, or specify which opcode and flags of the submission queue entry are
allowed, or require certain flags to be specified (these flags must be set on each submission queue entry).
All the restrictions must be submitted with a single io_uring_register() call and they are handled as an allowlist (opcodes and
flags not registered, are not allowed).
Restrictions can be registered only if the io_uring ring started in a disabled state (SETUP_R_DISABLED must be specified in the call to
setup).
Available since 5.10.
REGISTER_ENABLE_RINGS -
This operation enables an io_uring ring started in a disabled state (SETUP_R_DISABLED was specified in the call to setup).
While the io_uring ring is disabled, submissions are not allowed and registrations are not restricted. After the execution of this
operation, the io_uring ring is enabled: submissions and registration are allowed, but they will be validated following the registered
restrictions (if any). This operation takes no argument, must be invoked with arg set to NULL and nr_args set to zero.
Available since 5.10.
REGISTER_FILES2 -
Register files for I/O. Similar to REGISTER_FILES.
arg points to a struct io_uring_rsrc_register, and nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to an array of nr file descriptors (signed 32 bit integers). tags field should either be
0 or or point to an array of nr "tags" (unsigned 64 bit integers). See REGISTER_BUFFERS2 for more info on resource tagging.
Note that resource updates, e.g. REGISTER_FILES_UPDATE, don't necessarily deallocate resources, they might be held until all requests using that
resource complete.
Available since 5.13.
REGISTER_FILES_UPDATE2 -
Similar to REGISTER_FILES_UPDATE, replaces existing files in the registered file set with new ones, either turning a sparse entry (one where fd is
equal to -1) into a real one, removing an existing entry (new one is set to -1), or replacing an existing entry with a new existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of file descriptors to use for the update stored in data. tags points to an array of tags. nr must contain the number of
descriptors in the passed in arrays. See REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_BUFFERS2 -
Register buffers for I/O.
Similar to REGISTER_BUFFERS but aims to have a more extensible ABI. arg points to a struct io_uring_rsrc_register, and
nr_args should be set to the number of bytes in the structure.
The data field contains a pointer to a struct iovec array of nr entries. The tags field should either be 0, then tagging is
disabled, or point to an array of nr "tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this particular resource (a
buffer in this case) is disabled. Otherwise, after the resource had been unregistered and it's not used anymore, a CQE will be posted with
user_data set to the specified tag and all other fields zeroed.
Note that resource updates, e.g. REGISTER_BUFFERS_UPDATE, don't necessarily deallocate resources by the time it returns, but they might be held
alive until all requests using it complete.
Available since 5.13.
REGISTER_BUFFERS_UPDATE -
Updates registered buffers with new ones, either turning a sparse entry into a real one, or replacing an existing entry.
arg must contain a pointer to a struct io_uring_rsrc_update2, which contains an offset on which to start the update, and an array
of struct iovec. tags points to an array of tags. nr must contain the number of descriptors in the passed in arrays. See
REGISTER_BUFFERS2 for the resource tagging description.
Available since 5.13.
REGISTER_IOWQ_AFF -
By default, async workers created by io_uring will inherit the CPU mask of its parent.
This is usually all the CPUs in the system, unless the parent is being run with a limited set. If this isn't the desired outcome, the application
may explicitly tell io_uring what CPUs the async workers may run on.
arg must point to a cpu_set_t mask, and nr_args the byte size of that mask.
Available since 5.14.
UNREGISTER_IOWQ_AFF -
Undoes a CPU mask previously set with REGISTER_IOWQ_AFF.
Must not have arg or nr_args set.
Available since 5.14.
REGISTER_IOWQ_MAX_WORKERS -
By default, io_uring limits the unbounded workers created to the maximum processor count set by RLIMIT_NPROC and the bounded
workers is a function of the SQ ring size and the number of CPUs in the system. Sometimes this can be excessive (or too little, for bounded), and
this command provides a way to change the count per ring (per NUMA node) instead.
arg must be set to an unsigned int pointer to an array of two values, with the values in the array being set to the maximum count of
workers per NUMA node. Index 0 holds the bounded worker count, and index 1 holds the unbounded worker count. On successful return, the passed in
array will contain the previous maximum valyes for each type. If the count being passed in is 0, then this command returns the current maximum
values and doesn't modify the current setting. nr_args must be set to 2, as the command takes two values.
Available since 5.15.
REGISTER_RING_FDS -
Whenever enter is called to submit request or wait for completions, the kernel must grab a reference to the file descriptor. If the application
using io_uring is threaded, the file table is marked as shared, and the reference grab and put of the file descriptor count is more expensive than
it is for a non-threaded application.
Similarly to how io_uring allows registration of files, this allow registration of the ring file descriptor itself. This reduces the overhead of
the io_uring_enter (2) system call.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
The data field of this struct must point to an io_uring file descriptor, and the offset field can be either -1 or an
explicit offset desired for the registered file descriptor value. If -1 is used, then upon successful return of this system call, the field
will contain the value of the registered file descriptor to be used for future io_uring_enter (2) system calls.
On successful completion of this request, the returned descriptors may be used instead of the real file descriptor for io_uring_enter (2),
provided that IORING_ENTER_REGISTERED_RING is set in the flags for the system call. This flag tells the kernel that a registered
descriptor is used rather than a real file descriptor.
Each thread or process using a ring must register the file descriptor directly by issuing this request.
The maximum number of supported registered ring descriptors is currently limited to 16.
Available since 5.18.
UNREGISTER_RING_FDS -
Unregister descriptors previously registered with REGISTER_RING_FDS.
arg must be set to an unsigned int pointer to an array of type struct io_uring_rsrc_register of nr_args number of entries.
Only the offset field should be set in the structure, containing the registered file descriptor offset previously returned from
IORING_REGISTER_RING_FDS that the application wishes to unregister.
Note that this isn't done automatically on ring exit, if the thread or task that previously registered a ring file descriptor isn't exiting. It is
recommended to manually unregister any previously registered ring descriptors if the ring is closed and the task persists. This will free up a
registration slot, making it available for future use.
Available since 5.18.
REGISTER_PBUF_RING - register ring based provide buffer group
UNREGISTER_PBUF_RING - unregister ring based provide buffer group
REGISTER_SYNC_CANCEL - sync cancelation API
REGISTER_FILE_ALLOC_RANGE - register a range of fixed file slots for automatic slot allocation
REGISTER_LAST
REGISTER_USE_REGISTERED_RING
|
| public static final int |
|
| public static final int | IOSQE_ASYNCio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_BUFFER_SELECTio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_CQE_SKIP_SUCCESSio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_FIXED_FILEio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_IO_DRAINio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_IO_HARDLINKio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int | IOSQE_IO_LINKio_uring_sqe->flags bitfield values
Enum values:
IOSQE_FIXED_FILE -
When this flag is specified, fd is an index into the files array registered with the io_uring instance (see the REGISTER_FILES
section of the register man page).
Note that this isn't always available for all commands. If used on a command that doesn't support fixed files, the SQE will error with
-EBADF.
Available since 5.1.
IOSQE_IO_DRAIN -
When this flag is specified, the SQE will not be started before previously submitted SQEs have completed, and new SQEs will not be started before
this one completes.
Available since 5.2.
IOSQE_IO_LINK -
When this flag is specified, it forms a link with the next SQE in the submission ring.
That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long. The
tail of the chain is denoted by the first SQE that does not have this flag set. Chains are not supported across submission boundaries. Even if the
last SQE in a submission has this flag set, it will still terminate the current chain. This flag has no effect on previous SQE submissions, nor
does it impact SQEs that are outside of the chain tail. This means that multiple chains can be executing in parallel, or chains and individual
SQEs. Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring
considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links
is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.
Available since 5.3.
IOSQE_IO_HARDLINK -
Like IOSQE_IO_LINK, but it doesn't sever regardless of the completion result.
Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results
for requests that did submit correctly. IOSQE_IO_HARDLINK implies IOSQE_IO_LINK.
Available since 5.5.
IOSQE_ASYNC -
Normal operation for io_uring is to try and issue an sqe as non-blocking first, and if that fails, execute it in an async manner.
To support more efficient overlapped operation of requests that the application knows/assumes will always (or most of the time) block, the
application can ask for an sqe to be issued async from the start.
Available since 5.6.
IOSQE_BUFFER_SELECT -
Used in conjunction with the OP_PROVIDE_BUFFERS command, which registers a pool of buffers to be used by commands that read or receive data.
When buffers are registered for this use case, and this flag is set in the command, io_uring will grab a buffer from this pool when the
request is ready to receive or read data. If successful, the resulting CQE will have CQE_F_BUFFER set in the flags part of the struct, and the
upper CQE_BUFFER_SHIFT bits will contain the ID of the selected buffers. This allows the application to know exactly which buffer was selected for
the operation. If no buffers are available and this flag is set, then the request will fail with -ENOBUFS as the error code. Once a buffer
has been used, it is no longer available in the kernel pool. The application must re-register the given buffer again when it is ready to recycle it
(eg has completed using it).
Available since 5.7.
IOSQE_CQE_SKIP_SUCCESS -
Don't generate a CQE if the request completes successfully.
If the request fails, an appropriate CQE will be posted as usual and if there is no IOSQE_IO_HARDLINK, CQEs for all linked requests will be
omitted. The notion of failure/success is opcode specific and is the same as with breaking chains of IOSQE_IO_LINK. One special case is
when the request has a linked timeout, then the CQE generation for the linked timeout is decided solely by whether it has
IOSQE_CQE_SKIP_SUCCESS set, regardless whether it timed out or was cancelled. In other words, if a linked timeout has the flag set, it's
guaranteed to not post a CQE.
The semantics are chosen to accommodate several use cases. First, when all but the last request of a normal link without linked timeouts are marked
with the flag, only one CQE per link is posted. Additionally, it enables supression of CQEs in cases where the side effects of a successfully
executed operation is enough for userspace to know the state of the system. One such example would be writing to a synchronisation file.
This flag is incompatible with IOSQE_IO_DRAIN. Using both of them in a single ring is undefined behavior, even when they are not used together in
a single request. Currently, after the first request with IOSQE_CQE_SKIP_SUCCESS, all subsequent requests marked with drain will be failed
at submission time. Note that the error reporting is best effort only, and restrictions may change in the future.
Available since 5.17.
|
| public static final int |
|
| public static final int |
|