Skip to content

add io_uring buffer support

Florian Fischer requested to merge aj46ezos/emper:buffer-selection into master
  1. Add generic WaitQueue to model a BufferGroup
  2. Introduce RutimeBuilder to build a Runtime object with initial worker hooks. This is needed to register a BufferGroup on each worker's IoContext
  3. Misc changes to Fiber and PrivateSemaphore to allow PrepareBuffersFutures to be used in new worker hooks
  4. Extend the Future API and add the actual buffer code

TODO: Fix the BufferGroup wait problem.
The problem can be observed with the ConcurrentRegisteredBufferTest. Buffer notifications are not global and a notified Fiber may not wakeup on the worker where the notification happend.

Possible solutions:

  • Allocating new buffers if the group is empty and register them costing a syscall (not possible. because updating the registered buffers needs the ring to idle)
  • Dispatch the notified Fiber on notification so it will always wake up on the worker where the buffer is available and schedule the continuation of the notifying Fiber (not possible. It can not be controlled where a Fiber wakes up even using a direct dispatch because the notifying Fiber may not currently run on the Worker where the waiting Fiber was suspended)

Waiting for a RegisteredBuffer is not supported anymore. The user can try to get one of the current worker or call RegisteredBuffer::getOrAlloc() which will use a free registered one or tranparently allocate a new buffer.

Edited by Florian Fischer

Merge request reports