Age | Commit message (Collapse) | Author |
|
Tests overflows without CQ_NODROP, and correct behavior on a ring
setup with CQ_NODROP. The latter backlogs events that otherwise
would have been dropped, and returns -EBUSY to an application trying
to submit new IO with a backlog pending.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This missing define causes build failures on s390:
src/include/liburing.h:298: undefined reference to `io_uring_smp_mb'
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
submitted is always going to be non-zero, since we check if head and
tail are different at the start of the function.
Signed-off-by: Kornilios Kourtis <kornilios@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
ring->sq.kflags is set by the kernel. Ensure the compiler always loads
the value from memory when doing the check.
Signed-off-by: Kornilios Kourtis <kornilios@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Add the command opcode, and add two test cases for it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Not in a released version yet, plan for using the flags since we
already have the IORING_TIMEOUT_ABS flag.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Interface to the new file set update functionality.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Like io_uring_queue_init(), but allows passing in the whole parameter
structure, not just the flags.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Tests both existing functionality, but also the new sparse maps,
update/remove/add functionality.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We made a kernel change to support timeouts properly on 32-bit
archs, update liburing to use __kernel_timespec instead of the
differently sized timespec.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We lost the -ETIME return from a previous commit that optimized the
exported peek/wait cqe path, make sure that it works again.
Fixes: 20c929379461 ("Inline fast-path of io_uring_{wait,peek}_cqe()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
For cases where we usually have completions available, it can be fairly
costly to always have to call into the liburing library. Ensure that we
handle the fast path of finding completions without needing a library
call.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We also need the sigset for certain setups, and adding a third
option is pretty crazy. Since io_uring_wait_cqes_timeout() isn't
in a released version yet (and neither is io_uring_wait_cqes()),
make the necessary adjustments.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
The TIMEOUT command requires a valid timeout set, or we fail. We
don't need to arm a timer if we only need to wait for a certain
number of requests, so just punt to io_uring_wait_cqes() instead.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Allows to wait for a specific number of CQEs, which can be used more
optimally when we can inform the kernel of how many we are waiting
for.
Calling convention is the same as io_uring_wait_cqe(), we can only
return one cqe inline.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Used in two spots, instead of open coding it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also pass in correct to_submit and wait_nr.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
It really does two things:
1) Sync internal state with kernel ring on the SQ side
2) Submits the IO
Move step 1 to __io_uring_flush_sq(), so we can use them separately
from other functions.
No intential functional changes in this commit.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We've added three exported functions since 0.1. We should do the
right thing and add them under the next version specifically.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
io_uring_peek_batch_cqe(), get multiple cqe from the queue at once.
Returns the number of cqe gotten.
test/cq-peek-batch.c: tests io_uring_peek_batch_cqe()
Signed-off-by: James Rouzier <rouzier@gmail.com>
|
|
io_uring_cq_ready(), returns the number of completions that are ready.
test/cq-ready.c: tests io_uring_cq_ready
Signed-off-by: James Rouzier <rouzier@gmail.com>
|
|
At least for ceph, it fails to statically link with liburing because
we don't use -fPIC for the static version of the library.
This reverts commit a17aec8458544f5ad3ce234b4750dce35a621081.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Was just missing the sqe->timeout_flags, which are (as of yet) totally
unused.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also unify across subdirs.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Like io_uring_wait_cqe_timeout(), except this one takes an argument
for how many CQEs to ask for when waiting in the kernel.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We call this internally after queueing the timeout SQE anyway, so
the application doesn't have to do it upfront.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
* 'sq_space_left' of https://github.com/rouzier/liburing:
Add io_uring_sq_space_left()
|
|
Fixes: 76e9232baa00 ("Add io_uring_wait_cqe_timeout()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
io_uring_sq_space_left(), returns the amount of space left in the submission queue.
test/sq-space_left.c tests io_uring_sq_space_left
Signed-off-by: James Rouzier <rouzier@gmail.com>
|
|
Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note
that an sqe is used internally to handle the timeout. Applications using
this function must never set sqe->user_data to LIBURING_UDATA_TIMEOUT!
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also unify all the command prep helpers, so they all use the same core
function for setting up the commands. It was a bit hit and miss before
this change if it was done manually, or through a helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Add support for the current TIMEOUT variant. This allows passing
in a timeout and event count, first of which will trigger the
completion of the timeout command.
If the timeout is hit, the command completes with cqe->res == -ETIME.
If the asked number of events complete first, the command completes
with cqe->res == 0.
test/timeout.c tests a variety of timeout conditions.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We'll rework it for the final version, kill the early version
test case and liburing addition.
This reverts commits:
efb39e105afdb4dd5c0f1e964720cfa3cdcceb18
e4269d2c10586c03786df24d6382da99a956f03c
4652762d5be96e08a0ff8194de1e6f6d8127cee5
f102231b0fdbfe8587efda0b24c79a69ee4d8ba7
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
And associated command prep helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Hristo Venev <hristo@venev.name>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This brings in the features flags.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
io_uring depends on the caller specifying the index into the array
of registered buffers for doing pre-mapped IO. Make this explicit
by requiring the caller to pass in this value for the
io_uring_prep_read_fixed() and io_uring_prep_write_fixed() helpers.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Currently we return 0 if someone calls io_uring_peek_cqe(), but
we really should be returning 0 only if we managed to find a
completion entry.
Return -EAGAIN to notify the caller that no entries are there.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Rename the newly added arm barriers and READ/WRITE_ONCE
to avoid using popular names.
Signed-off-by: Julia Suvorova <jusual@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|