Skip to content
Snippets Groups Projects
  1. Jan 21, 2022
    • Florian Fischer's avatar
      introduce new Scheduler::scheduleOn(fiber, workerId) function · 24993175
      Florian Fischer authored
      This function is needed to deal with worker local ressources: io_uring
      requests for example.
      
      Each worker now always has a MPSC inbox queue which was already used
      in the laws scheduling strategy.
      Fibers can be scheduled to a specific worker using the new
      Scheduler::scheduleOn method.
      
      Since the inbox queues are now always present we can use a single
      FiberSource enum combining AbstractWorkStealingStrategy::FiberSource
      and LawsStrategy::FiberSource.
      
      The laws strategy now uses the inbox queues as its priority queues.
      With the only differenze that when scheduling to a inbox queue
      using the Scheduler::scheduleOn the Fiber lifes only in the inbox
      queue and not also simultaneously in a WSQ.
      
      Unrelated code changes made while touching the code anyway:
      * Introduce FiberSource::io which hints that a Fiber comes from the
        worker's own CQ.
      * Strongly type the fiber's source in NextFiberResult.
      * Make all scheduler functions return std::optional<NextFiberResult>
      * Cleanup the identation in nextFiberResultViaWorkStealing
      24993175
  2. Jan 16, 2022
  3. Jan 14, 2022
  4. Jan 11, 2022
  5. Dec 25, 2021
    • Florian Fischer's avatar
      make cancellation in all emper variants sound · 9c0f2143
      Florian Fischer authored
      * Document data races of a future's state.
      * Get and set a Future's state only through methods. This helps to
        add possibly needed atomic operations.
      * Use atomics to get/set cancel and prepare state in IO_SINGLE_URING vaiant
      * Add more IO debug messages
      * Use the BPS of Futures with callbacks similar to those of forgotten
        ones to signal their preparation. The preparation mark the
        last moment where the Future is used in EMPER and after that the memory
        can be dropped.
        ATTENTION: This means not that the used resources of the IO request
        can be dropped. The kernel may still use a supplied buffer for example.
      * Fix Future chain cancellation in SubmitActor
      9c0f2143
  6. Dec 24, 2021
    • Florian Fischer's avatar
      properly cancel future callbacks · 95722c1b
      Florian Fischer authored
      Currently canceling Futures would never happen because we
      issued the cancel request only with the pointer of the future.
      This works more by coincidence than by design because
      the PointerTags::Future tagged onto the submitted future pointer is 0.
      
      This does not work for callbacks because they are tagged with a
      PointerTags != 0 and they don't use their callback pointer rather
      than the future pointer.
      
      Fix this by exporting the tagging from IoContext::prepareFutureChain
      into IoContext::createFutureTag and use this when submitting a cancel
      sqe.
      
      Warn the user that they have to manually take care of the memory safety
      of the callback because we can not await the callback in Future::cancel.
      
      Add a test case to CancelFutureTest.
      95722c1b
  7. Dec 16, 2021
  8. Dec 06, 2021
  9. Dec 03, 2021
    • Florian Fischer's avatar
      reduce test load when logging · 905fb18b
      Florian Fischer authored
      I suspect some test which scale whith the number of CPUs to timeout
      mostly on jenkins2.
      This patch reduces the load when logging is active and increases the
      load when logging is off.
      Therefore our test build with debugoptimized will do less and hopefully
      only timeout when they actually hung and the release test will do
      more.
      905fb18b
  10. Nov 23, 2021
    • Florian Fischer's avatar
      add concurrent BPS test · 65a593bc
      Florian Fischer authored
      The test introduces multiple cycles of Semaphores and
      a Fiber for each semaphore blocking and signaling the next.
      Through work-stealing the fibers from a cycle should be spread
      across different workers and thus test concurrent use of
      BinaryPrivateSemaphores.
      
      Cycle of length 3: Sem A -> Sem B -> Sem C -> Sem A -> ...
      Algorithm:
      	if isFirstInCycle
      		signal next
      
      	wait
      
      	if not isFirstInCycle
      		signal next
      65a593bc
  11. Nov 10, 2021
    • Florian Schmaus's avatar
      Fixes for clang-tidy 13 · dfa64867
      Florian Schmaus authored
      While we do not have yet LLVM 13 in the gitlab-ci, I use it on my
      systems. So fix the new warnings found with clang-tidy 13.
      dfa64867
  12. Sep 24, 2021
    • Florian Fischer's avatar
      [ConcurrentNetworkEchoTest] scale work with the available CPUs and log_level · 6afbf1d3
      Florian Fischer authored
      The chosen amounts of echos take on my 16 core ryzen system ~5seconds.
      This should hopefully reduce CI timeout where we are not sure if they are
      bugs or legit timeouts. Furthermore this should reduce the amount of logs
      we write and have to store after each CI run.
      6afbf1d3
    • Florian Fischer's avatar
      [SimpleDiskAndNetworkTest] don't terminate the Runtime during the test · 5c1c60ca
      Florian Fischer authored
      Before 05dc56ed the two test cases testDiskAndNetwork, testIov
      where combined in one function which was terminating the runtime after the client
      closed its socketafter the test was done.
      This was already broken before 05dc56ed but after the separation of the
      two use cases the race between the Runtime terminating and the execution of
      the last parts of the test-runner's alphaFiber became bigger.
      
      When the Runtime terminates because the last worker running the testIoV
      code has outstanding IO the test-runner's successSem is never notified.
      5c1c60ca
  13. Sep 21, 2021
  14. Sep 16, 2021
  15. Sep 14, 2021
    • Florian Fischer's avatar
      [lib/LinuxVersion] multiple fixes · c1387013
      Florian Fischer authored
      * remove fancy but broken static LinuxVersion object.
        This means each usage of a EMPER_LINUX_* macro results in a syscall.
        But I think this is worth it when the result is a sound program.
        Users of those macros should store the result of the comparison anyway.
      * fix that we skipped parsing the last part of a version string
      * add a test for LinuxVersion
      * IO_MUST_INVALIDATE_BROKEN_CHAIN can still be const
      c1387013
  16. Sep 13, 2021
    • Florian Fischer's avatar
      [io/tests] use our own ASSERT macro unaffected by NDEBUG · 9fdc6e1a
      Florian Fischer authored
      This allows use to remove the current hack that the test are always
      build without NDEBUG regardless of the meson buildtype.
      
      Which is fact fixes the failing io tests in release builds.
      Because Future.hpp and Future.cpp see the same version of NDEBUG.
      9fdc6e1a
  17. Aug 19, 2021
  18. Aug 18, 2021
  19. Jul 29, 2021
  20. Jul 07, 2021
  21. Jul 06, 2021
  22. May 17, 2021
  23. May 04, 2021
  24. Apr 13, 2021
  25. Apr 01, 2021
  26. Mar 24, 2021
  27. Mar 23, 2021
    • Florian Fischer's avatar
      [Debug] s/WDBG/DBG and always terminate a log messager with a new line · 28028fac
      Florian Fischer authored
      Rename the macro used to build up the debug message, to better reflect
      its generality.
      It can be used anywhere to build a string with C++ stream formatting.
      std::string s = EMPER_BUILD_STR("foo = " << 1 " , bar = " << bar(42));
      
      Since WDBG was the only log macro without a terminating newline, which
      was in fact broken according to flow, we can remove it and the new line
      handling code in the LOG macro.
      28028fac
  28. Mar 18, 2021
    • Florian Fischer's avatar
      [IoContext] invalidate unsubmitted sqes · 03727b29
      Florian Fischer authored
      io_uring_submit does some inline error checking and consumes less
      cqes than prepared if an error is detected.
      
      Currently we just cancel the Futures, whose prepared sqes were not submitted.
      But this leaves already prepared sqes for those futures in the SQ
      of the io_uring which will be submitted the next time io_uring_submit
      is called.
      
      This results in a violation of the chain guaranty, that dependent operations
      are only executed if all dependencies were successful.
      Additionally this leads to double completions or memory corruption
      because the io_uring will produce cqes for already completed Futures.
      
      To prevent this from happening we track all sqes we prepared to
      invalidate and resubmit those which were not submitted because of a short submit.
      We invalidate sqes by preparing them as NOP instructions and set their
      user data to NULL.
      
      I took this approach instead of rewinding the ring or somethings like
      similar because it seemed safer for me not fiddle with io_uring internals
      and just be less efficient.
      
      Enable previously failing LinkFutureTest test cases.
      03727b29
    • Florian Fischer's avatar
      [IO] mark IO functions returning futures as nodiscard · 79f6eb9f
      Florian Fischer authored
      Fix compilation error in LinkFutureTest where clsoe was used instead
      of closeAndWait.
      79f6eb9f
Loading