- Jul 21, 2021
-
-
Florian Fischer authored
-
Florian Fischer authored
-
- Jul 15, 2021
-
-
Florian Schmaus authored
Implement sleep strategy using the IO subsystem See merge request i4/manycore/emper!214
-
- Jul 14, 2021
-
-
Florian Fischer authored
Design goals ============ * Wakeup either on external newWork notifications or on local IO completions -> Sleep strategy is sound without the IO completer * Do as less as possible in a system saturated with work * Pass a hint where to find new work to suspended workers Algorithm ========= Data: Global: hint pipe sleepers count Per worker: dispatch hint buffer in flight flag Sleep: if we have no sleep request in flight Atomic increment sleep count Remember that we are sleeping Prepare read cqe from the hint pipe to dispatch hint buffer Prevent the completer from reaping completions on this worker's IoContext Wait until IO completions occurred NotifyEmper(n): if observed sleepers <= 0 return // Determine how many we are responsible to wake do toWakeup = min(observed sleepers, n) while (!CAS(sleepers, toWakeup)) write toWakeup hints to the hint pipe NotifyAnywhere(n): // Ensure all n notifications take effect while (!CAS(sleepers, observed sleepers - n)) if observed sleeping <= -n return toWakeup = min(observed sleeping, n) write toWakeup hints to the hint pipe onNewWorkCompletion: reset in flight flag allow completer to reap completions on this IoContext Notes ===== * We must decrement the sleepers count on the notifier side to prevent multiple notifiers to observe all the same amount of sleepers, trying to wake up the same sleepers by writing to the pipe and jamming it up with unconsumed hints and thus blocking in the notify write resulting in a deadlock. * The CAS loops on the notifier side are needed because decrementing and incrementing the excess is racy: Two notifier can observe the sum of both their excess decrement and increment to much resulting in a broken counter. * Add the dispatch hint code in AbstractWorkStealingScheduler::nextFiber. This allows workers to check the dispatch hint after there where no local work to execute. This is a trade-off where we trade slower wakeup - a just awoken worker will check for local work - against a faster dispatch hot path when we have work to do in our local WSQ. * The completer tread must not reap completions on the IoContexts of sleeping workers because this introduces a race for cqes and a possible lost wakeup if the completer consumes the completions before the worker is actually waiting for them. * When notifying sleeping workers from anywhere we must ensure that all notifications take effect. This is needed for example when terminating the runtime to prevent sleep attempt from worker thread which are about to sleep but have not incremented the sleeper count yet. We achieve this by always decrementing the sleeper count by the notification count. Thanks to Florian Schmaus <flow@cs.fau.de> for spotting bugs and suggesting improvements.
-
- Jul 08, 2021
-
-
Florian Schmaus authored
[IO] document and adjust tests to changes in io_uring's broken link handling Closes #20 See merge request i4/manycore/emper!212
-
- Jul 07, 2021
-
-
Florian Fischer authored
[io/tests] gracefully terminate the runtime on success See merge request i4/manycore/emper!213
-
Florian Fischer authored
This allows the examination of stats which get printed in the Runtime destructor. Also remove useless stdlib includes (Why does iwyu not catch those?).
-
- Jul 06, 2021
-
-
Florian Fischer authored
Until kernel commit cf10960426515 io_uring submitted sqe until it encountered an invalid one. Now io_uring will catch the error on subimssion and will cancel all sqe's contained in the link prior to the invalid one.
-
- Jul 05, 2021
-
-
Florian Schmaus authored
[Runtime] use pthread_getaffinity_np to determine default worker count Closes #19 See merge request !211
-
Florian Fischer authored
The value reported by std::thread::hardware_concurrency() can be more than the available CPUs to the current process for example if EMPER runs in a container or qemu. GNU nproc(1) does the right thing and we can take inspiration from them. The solution is to use pthread_getaffinity_np which fills a CPU set with all CPU a pthread can be scheduled on. We use this more precise CPU count if possible.
-
- Jun 04, 2021
-
-
Florian Schmaus authored
[gitlab-ci] Bump flowdalic/debian-testing-dev to 1.12 See merge request !209
-
- May 28, 2021
-
-
Florian Schmaus authored
-
- May 20, 2021
-
-
Florian Schmaus authored
[Future] Fix clang-tidy issue in MadviseFuture See merge request !208
-
Florian Schmaus authored
-
Florian Schmaus authored
[gitlab-ci] Bump debian-testing-dev image to 1.10 See merge request !199
-
Florian Schmaus authored
-
- May 19, 2021
-
-
Florian Schmaus authored
[IO] add a madvise Future See merge request !206
-
- May 18, 2021
-
-
Florian Fischer authored
-
Florian Schmaus authored
Fix most llvm-12 clang-tidy warnings in IO code See merge request !205
-
Florian Schmaus authored
Batch dequeue from AnywhereQueue See merge request !196
-
- May 17, 2021
-
-
Florian Fischer authored
-
Florian Fischer authored
Thanks llvm 12 :)
-
Florian Fischer authored
errno was never set on error and thus the DIE_MSG_ERRNO did not properly report what happened. Found during changing Future member types.
-
Florian Fischer authored
The posix versions (close/openat) return int as well. And this fixes a narrowing conversion in c_emper.cpp: emper_openat and emper_close
-
Florian Fischer authored
Use int32_t as Future returnValue instead of ssize_t since io_uring uses int32_t not ssize_t as results value therefore it is pointless to use a bigger type. This shrinks the future size and prevents useless and implementation defined narrowing conversions from ssize_t to int32_t. Use union for flags and offset. Ignore int to pointer cast clang-tidy warning.
-
Florian Schmaus authored
[Debug] maybe-uninitialized should be ignored for gcc >= 11.1.0 See merge request i4/manycore/emper!204
-
Florian Fischer authored
-
Florian Schmaus authored
[check-license] Do not pass --max-args to xargs See merge request !203
-
Florian Schmaus authored
GCC 11.1 fixes See merge request !202
-
Florian Schmaus authored
[CountingPrivateSemaphore] Fix assert See merge request !200
-
Florian Schmaus authored
xargs: warning: options --max-args and --replace/-I/-i are mutually exclusive, ignoring previous --max-args value
-
Florian Fischer authored
-
Florian Fischer authored
gcc 11.1 on my arch system complains that the calls to free does not match the allocator function new[].
-
- May 14, 2021
-
-
Florian Schmaus authored
As the code comment above the assert indicates, the atomic exchange operation may either return nullptr or a valid Context pointer. And this is what the assert() should assert. :) Reported-by:
Florian Fischer <florian.fl.fischer@fau.de>
-
Florian Schmaus authored
-
Florian Schmaus authored
-
- May 11, 2021
-
-
Florian Schmaus authored
[Common] Call abort() instead of exit() in die() See merge request !198
-
Florian Schmaus authored
Calling abort() has multiple advantages. First, it better matches the semantic of DIE(_MSG) as it signals an abnormal process termination, whereas exit() is a normal process termination (even though potentially with an error exit code). Secondly, abort() throws SIGABRT, which in turn triggers a coredump, hence the program's state can be inspected afterwards.
-
- May 10, 2021
-
-
Florian Schmaus authored
[LAWS/Fiber] Introduce the concept of Multi-Fiber See merge request !195
-
Florian Schmaus authored
-