Commit ecd0d112 authored by Florian Fischer's avatar Florian Fischer
Browse files

io: do not use IO_FORGOTTEN_FUTURES_SKIP_CQE on linux <= 5.17

Apparantly my assumption that io_uring ignores unknown cqe flags is
wrong. And io_uring < Linux 5.17 completes forgotten futures with
-EINVAL.

Fixes: e140759d
parent faf89ab5
Pipeline #78723 passed with stages
in 18 minutes and 44 seconds
......@@ -141,6 +141,7 @@ void printInfo(std::ostream& strm) {
}
const bool IO_MUST_INVALIDATE_BROKEN_CHAIN = EMPER_LINUX_LT("5.15.0");
const bool IO_FORGOTTEN_FUTURES_SKIP_CQE = EMPER_LINUX_GE("5.17");
auto getFullVersion() -> std::string { return EMPER_FULL_VERSION; }
......
......@@ -212,6 +212,8 @@ const bool WAITFREE_IO_STEALING =
// warnings during the comparison use not yet initialized components is reduced.
extern const bool IO_MUST_INVALIDATE_BROKEN_CHAIN;
extern const bool IO_FORGOTTEN_FUTURES_SKIP_CQE;
enum class IoSqPoller {
off,
one,
......
......@@ -81,8 +81,8 @@ auto IoContext::prepareFutureChain(Future &future, unsigned chain_length) -> uns
if (future.isForgotten()) {
// Do not generate cqes for forgotten futures this reduces the kernel
// and user space overhead for cqes we do not need in the first place.
// This has no effect on kernel versions not supporing IOSQE_CQE_SKIP_SUCCESS.
sqe->flags |= IOSQE_CQE_SKIP_SUCCESS;
// IOSQE_CQE_SKIP_SUCCESS is supported since Linux 5.17
if (IO_FORGOTTEN_FUTURES_SKIP_CQE) sqe->flags |= IOSQE_CQE_SKIP_SUCCESS;
}
// If we use a single io_uring and a SubmitActor the submission and preparation
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment