[RFC] IO-stealing analogue to work-stealing
-
Review changes -
-
Download -
Patches
-
Plain diff
IO stealing is analog to work-stealing and means that worker thread without work will try to steal IO completions (CQEs) from other worker's IoContexts. The work stealing algorithm is modified to check a victims CQ after findig their work queue empty.
This approach in combination with future additions (global notifications on IO completions, and lock free CQE consumption) are a realistic candidate to replace the completer thread without loosing its benefits.
To allow IO stealing the CQ must be synchronized which is already the
case with the IoContext::cq_lock
.
Currently stealing workers always try to pop a single CQE (this could
be configurable).
Steal attempts are recorded in the IoContext's Stats object and
successfully stolen IO continuations in the AbstractWorkStealingWorkerStats
.
I moved the code transforming CQEs into continuation Fibers from reapCompletions into a seperate function to make the rather complicated function more readable and thus easier to understand.
Remove the default CallerEnvironment template arguments to make the code more explicit and prevent easy errors (not propagating the caller environment or forgetting the function takes a caller environment).
io::Stats
now need to use atomics because multiple thread may increment
them in parallel from EMPER and the OWNER.
And since using std::atomic<T*>
in std::map
is not easily possible we
use the compiler __atomic_*
builtins.
Add, adjust and fix some comments.
Merge request reports
- version 287f3f79ad
- version 278dcb46dd
- version 2647c12f4e
- version 25aa981297
- version 24117c4f47
- version 23c6c1698f
- version 229e578ab3
- version 21f4934c3a
- version 201ead7864
- version 19ec9247fc
- version 18b2c8e80a
- version 1703261758
- version 1602bd8aeb
- version 15d4d31e30
- version 14cde15c91
- version 13936f6a6b
- version 12626b8f9f
- version 119a1be317
- version 108c807c0d
- version 98d72466e
- version 8889f30d5
- version 738c76e91
- version 638c76e91
- version 5cc11d623
- version 42d85c1ec
- version 305fdf855
- version 29b2ed0d2
- version 1607dd251
- master (base)
- latest version67b0c77a6 commits,
- version 287f3f79ad8 commits,
- version 278dcb46dd7 commits,
- version 2647c12f4e7 commits,
- version 25aa9812976 commits,
- version 24117c4f478 commits,
- version 23c6c1698f6 commits,
- version 229e578ab36 commits,
- version 21f4934c3a5 commits,
- version 201ead78645 commits,
- version 19ec9247fc7 commits,
- version 18b2c8e80a7 commits,
- version 170326175811 commits,
- version 1602bd8aeb10 commits,
- version 15d4d31e3010 commits,
- version 14cde15c918 commits,
- version 13936f6a6b9 commits,
- version 12626b8f9f7 commits,
- version 119a1be3176 commits,
- version 108c807c0d6 commits,
- version 98d72466e5 commits,
- version 8889f30d55 commits,
- version 738c76e915 commits,
- version 638c76e917 commits,
- version 5cc11d6237 commits,
- version 42d85c1ec6 commits,
- version 305fdf8556 commits,
- version 29b2ed0d26 commits,
- version 1607dd2515 commits,
- Side-by-side
- Inline