Skip to content
Snippets Groups Projects
  1. Apr 08, 2024
  2. Mar 28, 2024
  3. Mar 27, 2024
  4. Mar 26, 2024
  5. Mar 25, 2024
  6. Dec 16, 2022
  7. Nov 23, 2022
  8. Sep 17, 2022
  9. Sep 16, 2022
  10. Sep 05, 2022
    • Florian Fischer's avatar
      AbstractIoSleepStrategy: remove erroneous assertion · 845111e3
      Florian Fischer authored
      In my master's thesis, I described in listing 4.4 an io_uring-based
      suspension and notification algorithm, which is slightly different from
      what emper does.
      
      The described algorithm does not reset the sleep state if a worker
      skips sleeping because of a global sleeper count of less than 0 (line 21).
      
      Emper does always reset the sleep state to SleeperState::Running if
      the sleep method returned early (either the worker was specifically
      notified or the global sleep count indicated to skip the sleep attempt).
      
      Both variants are sound, but invariably resetting the sleeper count to
      running minimizes the windows of useless specific notifications.
      
      However, the assertion in onNewWorkNotification assumes the sleep state
      is always SleeperState::Notified if a specific notification is received
      through the worker's io_uring.
      
      Emper, resetting the sleep state, introduces a race between the notifier
      observing the state as sleeping, setting it to notified, and posting a
      notification to the potential sleeper's io_uring.
      But the sleeper skips the sleep attempt because the global sleeper count
      righteously resetting its state to running while invalidating the
      assertion.
      
      Therefore we remove the assertion because it is not invariant.
      845111e3
    • Florian Fischer's avatar
      fix includes · 8dbcf286
      Florian Fischer authored
      8dbcf286
    • Florian Fischer's avatar
    • Florian Fischer's avatar
      IoSleepStrategies: increment notifications stats in the AbstractIoSleepStrategy · 58afcf72
      Florian Fischer authored
      The WaitfdSleepStrategy did not gather the amount of posted notifications
      but the PipeSleepStrategy did.
      Move the stats accounting into AbstractIoSleepStrategy so all derived
      strategies track the amount of written notifications.
      58afcf72
    • Florian Fischer's avatar
      always set sleeperState to Running when skipping sleep · d13e6147
      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.
      d13e6147
    • Florian Fischer's avatar
      use IORING_OP_MSG_RING instead of eventfds to notify specific · 9c416be8
      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.
      9c416be8
    • Florian Fischer's avatar
      e0954909
    • Florian Fischer's avatar
      support dynamic waitfd flags · 57387a87
      Florian Fischer authored
      57387a87
    • Florian Fischer's avatar
      enable notifySpecific · 61c418dc
      Florian Fischer authored
      61c418dc
    • Florian Fischer's avatar
      always use eventfds for specific worker IO based worker notifications · 1b66a8ec
      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.
      1b66a8ec
    • Florian Fischer's avatar
      add waitfd based sleep strategy · 814fd9aa
      Florian Fischer authored
      814fd9aa
    • Florian Fischer's avatar
      generalize IO sleep_strategy code · bdc1cf6e
      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.
      bdc1cf6e
    • Florian Fischer's avatar
      add scheduler support for IO hints · 4390d89e
      Florian Fischer authored
      4390d89e
  11. Jul 20, 2022
  12. Jul 19, 2022
  13. Jul 12, 2022
Loading