diff --git a/emper/io/Future.hpp b/emper/io/Future.hpp index 4bac70ce22cf656239af8e6d1e6a41e76e2425c9..09e4128acd47478a65eb328310e2a9b518a2eedf 100644 --- a/emper/io/Future.hpp +++ b/emper/io/Future.hpp @@ -21,12 +21,12 @@ #include "Common.hpp" #include "Debug.hpp" // for LOGD, LogSubsystem, LogSubsyst... #include "Emper.hpp" // for DEBUG -#include "Fiber.hpp" #include "Runtime.hpp" #include "emper-common.h" #include "io/Operation.hpp" // for Operation, operator<<, Operati... struct io_uring_sqe; +class Fiber; namespace emper::io { class Stats; @@ -73,16 +73,6 @@ class Future : public Logger<LogSubsystem::IO> { BPS sem; - // It would be OK to not initialize this member, since it is only - // set after the the Future is prepared and only read if the Future - // get completed from anywhere. - // However clang-tidy then starts to complain - // about clang-analyzer-optin.cplusplus.UninitializedObject - - // The workerId of the worker which submitted this Future - // This will be passed to the BPS when it is signalled from the completer thread - workeraffinity_t affinity = Fiber::NOT_AFFINE; - State state; /* IO operation to perform */ @@ -133,8 +123,7 @@ class Future : public Logger<LogSubsystem::IO> { virtual void completeFromAnywhere(int32_t res) { setCompletion(res); - // pass our worker affinity set during IoContext::submit - sem.signalFromAnywhere(&affinity); + sem.signalFromAnywhere(); } virtual auto completeAndGetContinuation(int32_t res) -> Fiber* { diff --git a/emper/io/IoContext.cpp b/emper/io/IoContext.cpp index 4fe1e748e747c8327cff9e0aa1dc607b9ff55857..cc377625889291f666e280ae0c26e6cdfd70d6ea 100644 --- a/emper/io/IoContext.cpp +++ b/emper/io/IoContext.cpp @@ -65,7 +65,7 @@ auto IoContext::prepareFutureChain(Future &future, unsigned chain_length) -> uns // we should start a new Fiber executing callback on completion if (future.callback) { LOGD("prepare " << future << " Callback " << future.callback); - // set the Callback affinity if the callback is scheduled from anywhere + // set the Callback's affinity to the submitting worker if (worker) future.callback->affinity = worker->getWorkerId(); io_uring_sqe_set_data(sqe, TaggedPtr(future.callback, static_cast<uint16_t>(PointerTags::Callback))); @@ -73,9 +73,6 @@ auto IoContext::prepareFutureChain(Future &future, unsigned chain_length) -> uns // Someone wants to be notified about the completion of this Future } else if (!future.isForgotten()) { io_uring_sqe_set_data(sqe, TaggedPtr(&future, static_cast<uint16_t>(PointerTags::Future))); - - // set the Future affinity passed to the BPS when signaled from anywhere - if (worker) future.affinity = worker->getWorkerId(); } future.state.submitted = true;