Skip to content
Snippets Groups Projects
Commit 618e6d51 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'blockable-affinity' into 'master'

[Blockable] Support worker affinity in PrivateSemaphore.signalFromAnywhere()

See merge request i4/manycore/emper!187
parents ee54369f e568fa9f
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,8 @@ class Blockable : public Logger<logSubsystem> { ...@@ -22,6 +22,8 @@ class Blockable : public Logger<logSubsystem> {
ContextManager& contextManager; ContextManager& contextManager;
workeraffinity_t* affinity = nullptr;
Blockable(Runtime& runtime) : runtime(runtime), contextManager(runtime.getContextManager()) {} Blockable(Runtime& runtime) : runtime(runtime), contextManager(runtime.getContextManager()) {}
// Older clang-tidy versions show a // Older clang-tidy versions show a
...@@ -47,7 +49,7 @@ class Blockable : public Logger<logSubsystem> { ...@@ -47,7 +49,7 @@ class Blockable : public Logger<logSubsystem> {
blockedContexts.erase(context); blockedContexts.erase(context);
} }
return Fiber::from([this, context]() { contextManager.discardAndResume(context); }); return Fiber::from([this, context]() { contextManager.discardAndResume(context); }, affinity);
} }
template <CallerEnvironment callerEnvironment = CallerEnvironment::EMPER> template <CallerEnvironment callerEnvironment = CallerEnvironment::EMPER>
......
...@@ -46,7 +46,10 @@ class PrivateSemaphore : protected Blockable<LogSubsystem::PS> { ...@@ -46,7 +46,10 @@ class PrivateSemaphore : protected Blockable<LogSubsystem::PS> {
return nullptr; return nullptr;
} }
void signalFromAnywhere() { signal<CallerEnvironment::ANYWHERE>(); } void signalFromAnywhere(workeraffinity_t* affinity = nullptr) {
this->affinity = affinity;
signal<CallerEnvironment::ANYWHERE>();
}
void signalAndExit() { void signalAndExit() {
if (Context* readyContext = signalInternal()) { if (Context* readyContext = signalInternal()) {
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "BinaryPrivateSemaphore.hpp" // for BPS #include "BinaryPrivateSemaphore.hpp" // for BPS
#include "CallerEnvironment.hpp" // for CallerEnvironment #include "CallerEnvironment.hpp" // for CallerEnvironment
#include "Debug.hpp" // for LOGD, LOGW #include "Debug.hpp" // for LOGD, LOGW
#include "Runtime.hpp" // for Runtime
#include "io/IoContext.hpp" // for IoContext #include "io/IoContext.hpp" // for IoContext
#include "io/Stats.hpp" // for Stats, Operation #include "io/Stats.hpp" // for Stats, Operation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment