Commits on Source (16)
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
Introduce AbstractIoSleepStrategy holding most of the code needed for a sleep strategy using an IO object fur suspension/notification. This changes are used in future patches to implement more IO-based sleep strategies.
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
Eventfds are pollable (no iow thread is blocked reading from the IO object) contrary to waitfds. And using pipes seams also rather excessive especially since we ensure that only a single notification is written before it is consumed. This makes the code of the IO-based sleep strategies easier and I would expect also faster.
-
Florian Fischer authored
449 is futex_waitv since linux 5.16.
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
-
Florian Fischer authored
With Linux 5.18 io_uring supports sending notifications between io_urings. This removes the need of writing to a specific eventfd to notify specific sleeping workers. This greatly reduces the complexity of the sued algorithm because we do not longer need to prepare two sleeps in an atomic way. The notify specific algorithm no can be similar to the one used by the semaphore implementation. The notifier sets the state of the specific worker to Notified and if its was previously sleeping it is responsible to send a wakeup message. When a worker is going to sleep it sets its state to Running if it was notified the state is reset and the sleep attempt skipped. Otherwise a global read is prepared if needed and the worker waits on its io_uring.
-
Florian Fischer authored
When the custom logic of the IO-based sleep strategies returns false we already have set the sleeper state to Sleeping and must reset it.
-
Florian Fischer authored
IOURING_OP_MSG_RING will creates two cqes on probably different rings. We do not need the cqe on the submitting ring therefore skip its generation and only track that on the messaged ring an additional cqe is expected.
-
Florian Fischer authored
Set the user_data to NewWorkNotification on the MSG_RING cqe to detect a possible failure (operation not supported by the kernel).
Showing
- emper/Emper.hpp 16 additions, 0 deletionsemper/Emper.hpp
- emper/FiberSource.hpp 1 addition, 0 deletionsemper/FiberSource.hpp
- emper/Runtime.hpp 5 additions, 1 deletionemper/Runtime.hpp
- emper/Worker.hpp 2 additions, 3 deletionsemper/Worker.hpp
- emper/io/IoContext.hpp 11 additions, 5 deletionsemper/io/IoContext.hpp
- emper/sleep_strategy/AbstractIoSleepStrategy.cpp 157 additions, 0 deletionsemper/sleep_strategy/AbstractIoSleepStrategy.cpp
- emper/sleep_strategy/AbstractIoSleepStrategy.hpp 303 additions, 0 deletionsemper/sleep_strategy/AbstractIoSleepStrategy.hpp
- emper/sleep_strategy/PipeSleepStrategy.cpp 17 additions, 151 deletionsemper/sleep_strategy/PipeSleepStrategy.cpp
- emper/sleep_strategy/PipeSleepStrategy.hpp 16 additions, 265 deletionsemper/sleep_strategy/PipeSleepStrategy.hpp
- emper/sleep_strategy/WaitfdSleepStrategy.cpp 72 additions, 0 deletionsemper/sleep_strategy/WaitfdSleepStrategy.cpp
- emper/sleep_strategy/WaitfdSleepStrategy.hpp 149 additions, 0 deletionsemper/sleep_strategy/WaitfdSleepStrategy.hpp
- emper/sleep_strategy/WorkerSleepStrategy.hpp 7 additions, 1 deletionemper/sleep_strategy/WorkerSleepStrategy.hpp
- emper/sleep_strategy/meson.build 2 additions, 0 deletionsemper/sleep_strategy/meson.build
- emper/strategies/AbstractWorkStealingScheduler.cpp 33 additions, 8 deletionsemper/strategies/AbstractWorkStealingScheduler.cpp
- emper/strategies/AbstractWorkStealingScheduler.hpp 2 additions, 0 deletionsemper/strategies/AbstractWorkStealingScheduler.hpp
- emper/strategies/AbstractWorkStealingStats.cpp 2 additions, 0 deletionsemper/strategies/AbstractWorkStealingStats.cpp
- emper/strategies/AbstractWorkStealingWorkerStats.cpp 1 addition, 0 deletionsemper/strategies/AbstractWorkStealingWorkerStats.cpp
- emper/strategies/AbstractWorkStealingWorkerStats.hpp 1 addition, 0 deletionsemper/strategies/AbstractWorkStealingWorkerStats.hpp
- meson.build 8 additions, 8 deletionsmeson.build
- meson_options.txt 20 additions, 1 deletionmeson_options.txt
emper/sleep_strategy/WaitfdSleepStrategy.cpp
0 → 100644
emper/sleep_strategy/WaitfdSleepStrategy.hpp
0 → 100644