- May 04, 2021
-
-
Florian Fischer authored
-
Florian Fischer authored
Set the affinity for Fibers created from the completer thread to the workerId where the completion originated from. First, we split up the Callback type in a user facing and an internal one. The internal one has a new affinity member which provides the memory for the new Fibers affinity buffer. This is memory safe because the Callback object is always heap allocated and freed when the CallbackFiber terminates. Second, each Future has an affinity member as well which will be passed to the BinaryPrivateSemaphore when calling signalFromAnywhere to again hint the originating worker. Both affinity values are set during the preparation of the Future in IoContext::prepareFutureChain because then we are sure in which worker's IoContext the completion will be generated.
-
Florian Fischer authored
First of all I think it makes sense for laws to also look at affinities of Fibers scheduled to the AnywhereQueue. But the actual reason is that IO completions scheduled from the completer could be dispatched from the priorityQueue before they are found in the expensive AnywhereQueue. But this comes with the cost of a vcall for scheduleFromAnywhere.
-
Florian Fischer authored
Using the STL iterator based approach has caused more harm than it has advantages. First of all it is unneeded we know how the Fibers we want to schedule are stored and don't need a algorithmic generic abstraction. We keep Fibers pointers in continues memory for memory locality benefits therefore we can simply use the C dynamic array style of passing the Fibers to the scheduler. This removes the template from the batched schedule methods and allows us to use virtual functions to specialize the batched scheduleFromAnywhere method.
-
Florian Schmaus authored
[LAWS] Set fiber affinity *before* dispatching it, not after See merge request !189
-
Florian Schmaus authored
-
- May 03, 2021
-
-
Florian Schmaus authored
[Blockable] Support worker affinity in PrivateSemaphore.signalFromAnywhere() See merge request !187
-
Florian Schmaus authored
[EchoClient] don't include shutdown duration in echo duration See merge request !181
-
Florian Schmaus authored
I do as IWYU guides.
-
Florian Schmaus authored
-
Florian Fischer authored
-
Florian Fischer authored
* Merge the two echo functions echo and linkedEcho into a single templated Client member function _run(). This reduces code duplication but the resulting echo loop is less readable because of more if constexpr switches. * Move more code out of the echo loop into separate functions: * unexpected echo message * on ECONNRESET handling * error handling * termination condition
-
Florian Fischer authored
-
Florian Fischer authored
* Shutdown the client connections after the echo phase has ended. * Send "quit\n" on the last client connection (Though it is not guarantied that there are no more open connection because we parallelize the termination) * Free memory after the Runtime has terminated
-
Florian Schmaus authored
Make decision how many workers to notify in Runtime See merge request !183
-
Florian Fischer authored
The decision how many workers should be notified on new work should be made in the runtime. This is the whole reason why WorkerWakeupStrategies provide notify{One,Many,All} functions. This change also simplifies the logic used in SemaphoreWorkerSleepStrategy. The old simply copy-pasted semaphore based implementation could then be split up into much smaller and simpler pieces. SemaphoreWorkerSleepStrategy::notify{All, Many} is could actually be faster because it can now use the semaphores notify_many function instead of calling notifyInternal multiple times.
-
Florian Schmaus authored
[check-license] exclude subprojects and use year and git user.name for autofixing See merge request !185
-
Florian Schmaus authored
[Runtime] disable worker pinning using EMPER_DISABLE_PINNING environment variable See merge request !182
-
- May 01, 2021
-
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Schmaus authored
[WorkerSleepStrategy] call the correct implementation method See merge request !184
-
Florian Fischer authored
-
- Apr 30, 2021
-
-
Florian Fischer authored
-
- Apr 27, 2021
-
-
Florian Schmaus authored
[IO] provide memory to store continuation Fiber* by the caller See merge request !180
-
- Apr 21, 2021
-
-
Florian Fischer authored
Reason for this change is that we suspect the dynamic memory allocation in reapCompletions for the return vector to be rather costly. We know the maximum amount of memory needed to store continuation Fiber* at compile-time because the size of the CQs is fixed. This allows us to pass a buffer big enough to store all possible continuation Fiber* to reapCompletions from the caller preventing the need for the dynamic memory allocation for the returned vector. The caller has to ensure that the memory is free of data races. Currently this is ensured by allocating the buffer on the stack.
-
- Apr 20, 2021
-
-
Florian Schmaus authored
[io/Stats] do not try to print the globalIo stats if there are none See merge request !178
-
Florian Fischer authored
-
Florian Schmaus authored
[io] do not reap completions after resubmitting a PartialCompletableFuture Closes #17 See merge request !177
-
- Apr 19, 2021
-
-
Florian Fischer authored
Reaping completions after resubmitting a PartialCompletableFuture can lead to unbound recursion when the resubmitted Future was again partially completed during the resubmission. We already observed a stack overflow due to recursion for this in the IncrementalCompletionTest using completer thread with wakeup behaviour.
-
Florian Fischer authored
[EchoServer] fix echo function See merge request !176
-
Florian Fischer authored
The break was not in the right scope and thus exiting the echo loop immediately in the first iteration.
-
Florian Schmaus authored
[EchoServer] exit the echo server by terminate the runtime See merge request !175
-
Florian Fischer authored
Since stats are printed in the Runtime destructor we can not simply call exit() and have to properly terminate the Runtime. When the echo server receives a "quit" message all active connections will return and the Runtime will terminate if there is no work left.
-
- Apr 18, 2021
-
-
Florian Schmaus authored
introduce new CRTP based worker sleep algorithm abstraction See merge request !172
-
Florian Fischer authored
Introduce AbstractWorkerSleepStrategy a CRTP interface class for a worker sleep algorithm. A concrete WorkerSleepStrategy must implement the following functions: template <CallerEnvironment callerEnvironment> void notifyMany(unsigned count); template <CallerEnvironment callerEnvironment> void notifyOne(); template <CallerEnvironment callerEnvironment> void notifyAll(); void notifySpecific(workerid_t workerId); void sleep(); The runtime uses this interface to notify the workers about new work as well as ensuring that all workers get notified on termination. All sempahore based worker sleep algorithm code was moved from the Runtime into SemaphoreWorkerSleepStrategy which takes the used Semaphore as a template parameter. This interface should be an zero-cost abstraction. Encapsulating the worker sleep algorithm behind an interface allows us to easier experiment with different approaches not based on semaphores ("Wait in the io_uring", "Empty flag per WSQ"). Implement a generic notifySpecific algorithm for SemaphoreWorkerSleepStrategy. This algorithm comes with runtime overhead and is only used when it is used by the runtime and the semaphore implementation does not provide a own implementation.
-
- Apr 17, 2021
-
-
Florian Schmaus authored
[EchoClient] support latency histograms See merge request !174
-
Florian Fischer authored
Histograms can only be collected when using a fixed amount of iterations. When the '--histogram <file>' argument is passed each Client collects 4 time stamps (each 8 byte): 1. Before requesting the send operation 2. After requesting the send operation 3. After getting unblocked and dispatched because the send operation finished 4. After getting unblocked and dispatched because the recv operation finished Taking the timestamps is enabled using a template and thus does not introduce any runtime cost if they are not used except binary size. Before termination three latencies are calculated and written to the histogram file as csv data for each client and each echo. 1. total_latency := (T4 - T1) 2. after_send_latency := (T4 - T2) 3. after_send_dispatch_latency := (T4 - T3)
-
- Apr 16, 2021
-
-
Florian Schmaus authored
[repare-build-dir] Check for unknown meson options See merge request i4/manycore/emper!173
-
Florian Schmaus authored
Meson does only emit a warning if unknown options are passed. In our case, this is always something we should take care of, because an option we assumed we configured, had no effect. See also https://github.com/mesonbuild/meson/pull/8658
-
Florian Schmaus authored
[EchClient] calculate and output experiment totals See merge request !171
-