1. 03 Feb, 2024 9 commits
  2. 01 Feb, 2024 3 commits
  3. 26 Jan, 2024 2 commits
  4. 16 Jan, 2024 5 commits
    • Nils Goroll's avatar
      buddy: fix buddy_reqs_wait_prio_adjust() · 42481d56
      Nils Goroll authored
      This fixes two bugs:
      
      The most relavant was that we did not increase buddy->wait_pri if the
      new priority was higher, which could lead to all kinds of weird effects,
      for example:
      
      - starvation/lock up
      - LRU removing all of the cache
      
      because there were requests waiting, but buddy_wait_work() did not see
      them.
      
      The second bug is that we also called buddy_wait_work() if there
      actually was no change (the critical region could find state ==
      IW_SIGNALLED).
      
      Also, for the new assertions, we need to set the proper wait_pri for the
      case that the priority is lowered.
      42481d56
    • Nils Goroll's avatar
      buddy: fix wait_pri for buddy_reqs_wait_cancel() · 9e88cd29
      Nils Goroll authored
      we did not lower buddy->wait_pri if the cancel resulted in an empty
      priority list. This was no problem, but the stricter assertions from the
      previous commit would trigger, because they now require that the
      priority list for wait_pri is filled.
      9e88cd29
    • Nils Goroll's avatar
      0e7e0670
    • Nils Goroll's avatar
      9ecc70d3
    • Nils Goroll's avatar
      Add a priority to BUDDY_POOL_INIT() · 73a860d5
      Nils Goroll authored
      For clarity and to not overlook it, pools should have a proper default
      priority. The fill callback can still change it.
      73a860d5
  5. 13 Jan, 2024 7 commits
  6. 06 Jan, 2024 1 commit
  7. 26 Dec, 2023 1 commit
  8. 22 Dec, 2023 5 commits
    • Nils Goroll's avatar
      Fix and radically simplify logbuffer_wait_flush_fini() · b81832bf
      Nils Goroll authored
      The dance of taking a reference when waiting caused a lot of trouble
      already before, and with a fresh look at it does not seem to make much
      sense. But most importantly, it was wrong:
      
      lbuf->ff was set to NULL in logbuffer_flush_finish_work_one() before
      the mutex was returned with pthread_cond_wait(), so
      
      	if (ff == NULL)
      		goto unlock;
      
      in logbuffer_wait_flush_fini() could lead to the function returning
      before logbuffer_flush_finish_work_one() _was_ actually done.
      
      But with bceec122 this could lead
      to the stack memory being repurposed (logbuffer_flush_finish
      returning) before it was actually safe to.
      
      This issue could surface in fellow_log_test hanging.
      
      We also now return all allocations under the lock to prevent a race
      with fellow_log_close() where flush finish threads could outlive the
      ffd, resulting in buddy leak detection to fire, because the ff
      allocation was not returned.
      
      Fixes #49
      b81832bf
    • Nils Goroll's avatar
      Buddy: fix cramlimit_bits() · 95ec7bce
      Nils Goroll authored
      The other assertion is what we actually mean:
      
      The log2up(sz) must be at least bits, otherwise it makes no sense.
      95ec7bce
    • Nils Goroll's avatar
      Buddy: reprioritize requests before waiting · 96902eaa
      Nils Goroll authored
      96902eaa
    • Nils Goroll's avatar
      Buddy: copy the priority from reqs to i_wait · 2ab01664
      Nils Goroll authored
      otherwise all hell will break loose if we changed reqs->pri, because
      we would dequeue from the wrong list head.
      2ab01664
    • Nils Goroll's avatar
      3a49292f
  9. 21 Dec, 2023 6 commits
  10. 20 Dec, 2023 1 commit