• Nils Goroll's avatar
    Regionlist overhaul: Allocate regionlists asynchronously · 39c2568e
    Nils Goroll authored
    regionlists are updated during DLE submit under the logmtx. Thus, we
    should avoid synchronous memory allocations.
    
    We change the strategy as follows:
    
    * Memory for the top regionlist (which has one regl embedded) _is_
      allocated synchronously, but with maximum cram to reduce latencies
      at the expense of memory efficiency.
    
      The case where the allocation does block will not hit us for the
      most critical path in fellow_log_dle_submit(), because we
      pre-allocate there outside the logmtx.
    
    * When we create the top regionlist, we make two asynchronous memory
      allocation requests for our hard-coded size (16KB for prod), one
      crammed and one not. The crammed request is made such that we get
      _any_ memory rather than waiting.
    
    * When we need to extend the regionlist, we should already have an
      allocation available (if not, we need to wait, bad luck). The next
      allocation available is either [1] (uncrammed) left over after the
      previous extension, or [0], which is potentially crammed. If it is
      and we have an uncrammed [1], then we use that and return the
      crammed allocation. If there are no allocations left, we issue the
      next asynchronous request.
    39c2568e
fellow_regionlist.h 8.47 KB