diff --git a/emper/Emper.cpp b/emper/Emper.cpp index 9b8e29cfcddf1fb7255561c1c1727e16258a36a5..9f8527a517718a0ba70cfa14506e4e7141f2a76d 100644 --- a/emper/Emper.cpp +++ b/emper/Emper.cpp @@ -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; } diff --git a/emper/Emper.hpp b/emper/Emper.hpp index 77c40ed1c3b0c9eeb40161f29f1abc5e0733de1c..42a7465a7788509418bb70d063b32ff00a29cdfe 100644 --- a/emper/Emper.hpp +++ b/emper/Emper.hpp @@ -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, diff --git a/emper/io/IoContext.cpp b/emper/io/IoContext.cpp index 0d94256f070ff7455242bc8a3698566878b03ae6..22aeaa2df0ba04ec03eb2cfe0d6fe74af3a0605c 100644 --- a/emper/io/IoContext.cpp +++ b/emper/io/IoContext.cpp @@ -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