Skip to content
  • Florian Fischer's avatar
    [IO] give each worker its own IoContext · f3af9091
    Florian Fischer authored
    IO requests issued from fibers will be queued into the io_uring of
    the worker's IoContext.
    Before retrieving the next fiber to run in the DispatchLoop the
    worker tries to reap all completions which occurred in its io_uring and
    schedules the now runnable fibers.
    
    To process IO completions on sleeping worker threads there exists
    a global completer thread.
    All worker io_urings register an eventfd which signals ready completions
    and insert a read from this eventfd into a global io_uring.
    The global completer thread waits for completions on the global io_uring,
    which signal available completions on a worker's IoContext and tries to
    reap the worker's completions and schedules all now runnable Fibers
    on the AnywhereQueue.
    
    The assumption of this design is that it reduces contention on the IO
    subsystem and schedules fibers blocked on IO back into the workers
    work-stealing queue and not into the global AnywhereQueue.
    f3af9091