summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-11tests: make the per-test device/file map TEST_MAPJens Axboe
It's fine to be able to specify per test files, but it's a pain for other cases. Make TEST_FILES just be a generic list of files again, and use those if the file(s) for the test in question is empty. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-11src/queue: never clear data->wait_nrJens Axboe
We're factoring in how many completions we have already, both in liburing and in the kernel. Hence there's no need to ever clear it, and in fact it causes issues with early return where we don't have the required number of CQEs available. While in there, get rid of the silly 'to_wait' variable. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-11test/sq-poll-share: don't ignore wait errorsPavel Begunkov
Check io_uring_wait_cqe() result, it's not safe to poke into cqe on error. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-11test/link-timeout: close pipes after yourselfPavel Begunkov
Close pipe fds when we exit test_single_link_timeout(). Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-11src/queue: control kernel enter with a varPavel Begunkov
We check twice for all entering conditions in _io_uring_get_cqe(), first to set flags, and the second to potentially break the loop. Save it into a need_enter var. Also, don't set IORING_ENTER_GETEVENTS when there is already enough of events in the CQ. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-11src/queue: don't re-wait for CQEsPavel Begunkov
If ret==to_submit then io_uring_enter did go to waiting path and we should not repeat it. And that was the intention of a post syscall data->submit check, but reshuffling spoiled it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-10Add test case for circular reference SQPOLL hangJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-08Merge branch 'AddDocForSplice' of https://github.com/NobodyXu/liburingJens Axboe
* 'AddDocForSplice' of https://github.com/NobodyXu/liburing: Add inline doc in the comments for io_uring_prep_splice
2021-02-08Merge branch 'master' of https://github.com/CarterLi/liburingJens Axboe
* 'master' of https://github.com/CarterLi/liburing: src/queue.c: don't test `LIBURING_UDATA_TIMEOUT` for the latest kernel since we don't use it internally
2021-02-08src/queue: don't loop when don't enterPavel Begunkov
_io_uring_get_cqe() can live-lock in some cases, always return if we're not going to do __sys_io_uring_enter(). Reported-by: Victor Stewart <v@nametag.social> Suggested-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-08src/queue: clean _io_uring_get_cqe() err handlingPavel Begunkov
Doesn't change behaviour, just a little cleanup. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-08src/queue: don't wait for less than expectedPavel Begunkov
__io_uring_peek_cqe() doesn't consume cqe it returns, no need to decrease wait_nr because we check against the number in CQ as well as the kernel do. One exception for that behaviour is IOPOLL, but that kernel will return if there is anything in CQ, so will work just fine. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-08src/queue.c: don't test `LIBURING_UDATA_TIMEOUT`李通洲
for the latest kernel since we don't use it internally Signed-off-by: 李通洲 <carter.li@eoitek.com>
2021-02-07test/poll*: use appropriately sized CQ ringJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-07Add inline doc in the comments for io_uring_prep_spliceJiahao XU
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2021-02-04Merge branch 'patch-2' of https://github.com/NobodyXu/liburingJens Axboe
* 'patch-2' of https://github.com/NobodyXu/liburing: Fix sigset_t not found in liburing.h
2021-02-05Fix sigset_t not found in liburing.hJiahao XU
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2021-02-02src/queue: update comment on io_uring_wait_cqes() with timeoutsJens Axboe
For newer kernels, we DON'T submit automatically. And since we don't do that, it is safe to use this function with split SQ and CQ handling. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26test/drain: test draining linked timeoutsPavel Begunkov
Make sure references are accounted well when we defer reqs with linked timeouts. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26test/file-register: skip file skipping on older kernelsJens Axboe
All new op testing should include this, so that tests continue to work on older kernels... Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26test/file-register: cleanupsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26io_uring.h: 5.12 pending kernel syncJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26man/io_uring_register.2: fix spelling errorJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-26Merge branch 'master' of https://github.com/goldsteinn/liburingJens Axboe
* 'master' of https://github.com/goldsteinn/liburing: man/io_uring_register.2: Add documentation on IORING_REGISTER_FILES_SKIP test/file-register.c: Add tests for skipping file
2021-01-26man/io_uring_register.2: Add documentation on IORING_REGISTER_FILES_SKIPnoah
Add documentation for IORING_REGISTER_FILES_SKIP feature in IORING_REGISTER_FILES_UPDATE. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2021-01-26test/file-register.c: Add tests for skipping filenoah
This commit add test_skip which tests that IORING_REGISTER_FILES_UPDATE will succeed with fds set as IORING_REGISTER_FILES_SKIP and that the underlying registered file is unaffected. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2021-01-26test: use a map to define test files / devices we needHao Xu
Different tests need different files / devices, use a map to indicate what each test need. Signed-off-by: Hao Xu <haoxu@linux.alibaba.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24tests: add another timeout sequence test caseMarcelo Diop-Gonzalez
This test case catches an issue where timeouts may not be flushed if the number of new events is greater (not equal) to the number of events requested in the timeout. Signed-off-by: Marcelo Diop-Gonzalez <marcelo827@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24Add .gitignore entries for recent testsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24Add two ring deadlock caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24Add circular poll ring test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-24Merge branch 'io_uring_enter_man_fallocate' of ↵Jens Axboe
https://github.com/jorangreef/liburing * 'io_uring_enter_man_fallocate' of https://github.com/jorangreef/liburing: Fix IORING_OP_FALLOCATE args in io_uring_enter(2) man page
2021-01-23Fix IORING_OP_FALLOCATE args in io_uring_enter(2) man pageJoran Dirk Greef
`addr` must in fact contain the length. `len` is used for the fallocate mode. See: https://patchwork.kernel.org/project/linux-fsdevel/patch/ 20191213183632.19441-2-axboe@kernel.dk/ Signed-off-by: Joran Dirk Greef <joran@coil.com>
2021-01-21test/self: skip if argument passed inJens Axboe
Also ignore -EOPNOTSUPP for now. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-21Add test case for thread exiting with pending IOJens Axboe
A thread exiting should not have its IO canceled, that should only happen when the parent exits. Test that we are able to issue IO from a thread, with the parent reaping the completion when the thread exits. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-15Merge branch 'dev/cosmetics' of https://github.com/nunojsa/liburingJens Axboe
* 'dev/cosmetics' of https://github.com/nunojsa/liburing: src/queue: Fix a typo in `__io_uring_flush_sq()` src/queue: fix `sq_ring_needs_enter()` indentation
2021-01-14src/queue: Fix a typo in `__io_uring_flush_sq()`Nuno Sa
There was a typo in the comment explaining why it's ok to read `khead` without a barrier. Signed-off-by: Nuno Sa <noname.nuno@gmail.com>
2021-01-14src/queue: fix `sq_ring_needs_enter()` indentationNuno Sa
Signed-off-by: Nuno Sa <noname.nuno@gmail.com>
2021-01-07src/queue: refactor io_uring_get_sqe()Pavel Begunkov
Inline __io_uring_get_sqe() and clean up ugly naming left from it being a macro at some point. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-07tests: test fixed file removal orderPavel Begunkov
Do two file removals on a fixed file that used by an inflight request and make sure it goes well. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-06tests: identify timed out tests correctlyPavel Begunkov
We want to get a stable status (i.e. -124) when a test has timed out, but --preserve-status makes it to return whatever the process got. Remove the flag, it behaves same but if timed out passes back -124. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-18man/io_uring_setup.2: correct 5.10 -> 5.11 for non-fixed files and SQPOLLJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-18man/io_uring_enter.2: document new opcodesJens Axboe
Add documentation for IORING_OP_SHUTDOWN, IORING_OP_RENAMEAT, and IORING_OP_UNLINKAT. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-18man/io_uring_enter.2: ensure all IORING_ENTER_* flags are documentedJens Axboe
Fixes: https://github.com/axboe/liburing/issues/271 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-17src/queue: add comment on why reading SQ->head for flush isn't atomicJens Axboe
This has come up at least two times, add a comment there to explain exactly why the code is fine as-is. Fixes: https://github.com/axboe/liburing/issues/268 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-17liburing.h: fix 32-bit compile warningJens Axboe
Cast 'ts' to uintptr_t, to avoid having the compiler complain about casting it to a 64-bit size. ../src/include/liburing.h: In function ‘io_uring_prep_timeout_update’: ../src/include/liburing.h:342:42: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 342 | (void *)(unsigned long)user_data, 0, (__u64)ts); | ^ Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-17Merge branch 'fix-type-manpage' of https://github.com/goldsteinn/liburingJens Axboe
* 'fix-type-manpage' of https://github.com/goldsteinn/liburing: man/io_uring.7: Fix typo
2020-12-17man/io_uring.7: Fix typonoah
Fixing typo: being -> begin Signed-off-by: Noah <goldstein.w.n@gmail.com>
2020-12-17Merge branch 'liburing-add-branch-helpers' of ↵Jens Axboe
https://github.com/goldsteinn/liburing * 'liburing-add-branch-helpers' of https://github.com/goldsteinn/liburing: Added __builtin_expect macros and wrapped IORING_ENTER_SQ_WAKEUP branch
2020-12-17Added __builtin_expect macros and wrapped IORING_ENTER_SQ_WAKEUP branchnoah
If heavy IO load then kernel thread will only very rarely need to be woken up. Only case where this condition is common is if timeout expected between IO calls in which case should be using GETEVENTS. This will avoid the compiler from optimizing the wakeup branch Signed-off-by: Noah <goldstein.w.n@gmail.com>