Skip to content
  1. Mar 07, 2015
    • Jason Evans's avatar
      Fix a chunk_recycle() regression. · 04ca7580
      Jason Evans authored
      This regression was introduced by
      97c04a93 (Use first-fit rather than
      first-best-fit run/chunk allocation.).
      04ca7580
    • Jason Evans's avatar
      Use first-fit rather than first-best-fit run/chunk allocation. · 97c04a93
      Jason Evans authored
      This tends to more effectively pack active memory toward low addresses.
      However, additional tree searches are required in many cases, so whether
      this change stands the test of time will depend on real-world
      benchmarks.
      97c04a93
    • Jason Evans's avatar
      Quantize szad trees by size class. · 5707d6f9
      Jason Evans authored
      Treat sizes that round down to the same size class as size-equivalent
      in trees that are used to search for first best fit, so that there are
      only as many "firsts" as there are size classes.  This comes closer to
      the ideal of first fit.
      5707d6f9
    • Jason Evans's avatar
      Change default chunk size from 4 MiB to 256 KiB. · f044bb21
      Jason Evans authored
      Recent changes have improved huge allocation scalability, which removes
      upward pressure to set the chunk size so large that huge allocations are
      rare.  Smaller chunks are more likely to completely drain, so set the
      default to the smallest size that doesn't leave excessive unusable
      trailing space in chunk headers.
      f044bb21
  2. Mar 04, 2015
    • Mike Hommey's avatar
      Preserve LastError when calling TlsGetValue · 4d871f73
      Mike Hommey authored
      TlsGetValue has a semantic difference with pthread_getspecific, in that it
      can return a non-error NULL value, so it always sets the LastError.
      But allocator callers may not be expecting calling e.g. free() to change
      the value of the last error, so preserve it.
      4d871f73
    • Mike Hommey's avatar
      Make --without-export actually work · 7c46fd59
      Mike Hommey authored
      9906660e added a --without-export configure option to avoid exporting
      jemalloc symbols, but the option didn't actually work.
      7c46fd59
  3. Feb 26, 2015
  4. Feb 19, 2015
  5. Feb 18, 2015
  6. Feb 17, 2015
    • Jason Evans's avatar
      Integrate whole chunks into unused dirty page purging machinery. · ee41ad40
      Jason Evans authored
      Extend per arena unused dirty page purging to manage unused dirty chunks
      in aaddtion to unused dirty runs.  Rather than immediately unmapping
      deallocated chunks (or purging them in the --disable-munmap case), store
      them in a separate set of trees, chunks_[sz]ad_dirty.  Preferrentially
      allocate dirty chunks.  When excessive unused dirty pages accumulate,
      purge runs and chunks in ingegrated LRU order (and unmap chunks in the
      --enable-munmap case).
      
      Refactor extent_node_t to provide accessor functions.
      ee41ad40
  7. Feb 16, 2015
  8. Feb 15, 2015
  9. Feb 14, 2015
  10. Feb 13, 2015
  11. Feb 12, 2015
    • Jason Evans's avatar
      Refactor huge_*() calls into arena internals. · 88fef7ce
      Jason Evans authored
      Make redirects to the huge_*() API the arena code's responsibility,
      since arenas now take responsibility for all allocation sizes.
      88fef7ce
    • Daniel Micay's avatar
      add missing check for new_addr chunk size · 1eaf3b6f
      Daniel Micay authored
      8ddc9329 switched this to over using the
      address tree in order to avoid false negatives, so it now needs to check
      that the size of the free extent is large enough to satisfy the request.
      1eaf3b6f
    • Jason Evans's avatar
      Move centralized chunk management into arenas. · cbf3a6d7
      Jason Evans authored
      Migrate all centralized data structures related to huge allocations and
      recyclable chunks into arena_t, so that each arena can manage huge
      allocations and recyclable virtual memory completely independently of
      other arenas.
      
      Add chunk node caching to arenas, in order to avoid contention on the
      base allocator.
      
      Use chunks_rtree to look up huge allocations rather than a red-black
      tree.  Maintain a per arena unsorted list of huge allocations (which
      will be needed to enumerate huge allocations during arena reset).
      
      Remove the --enable-ivsalloc option, make ivsalloc() always available,
      and use it for size queries if --enable-debug is enabled.  The only
      practical implications to this removal are that 1) ivsalloc() is now
      always available during live debugging (and the underlying radix tree is
      available during core-based debugging), and 2) size query validation can
      no longer be enabled independent of --enable-debug.
      
      Remove the stats.chunks.{current,total,high} mallctls, and replace their
      underlying statistics with simpler atomically updated counters used
      exclusively for gdump triggering.  These statistics are no longer very
      useful because each arena manages chunks independently, and per arena
      statistics provide similar information.
      
      Simplify chunk synchronization code, now that base chunk allocation
      cannot cause recursive lock acquisition.
      cbf3a6d7
    • Jason Evans's avatar
      f30e261c
    • Jason Evans's avatar
      Fix a regression in tcache_bin_flush_small(). · 064dbfba
      Jason Evans authored
      Fix a serious regression in tcache_bin_flush_small() that was introduced
      by 1cb181ed (Implement explicit tcache
      support.).
      064dbfba
  12. Feb 11, 2015
  13. Feb 10, 2015
  14. Feb 05, 2015
    • Jason Evans's avatar
      Refactor rtree to be lock-free. · 8d0e04d4
      Jason Evans authored
      Recent huge allocation refactoring associates huge allocations with
      arenas, but it remains necessary to quickly look up huge allocation
      metadata during reallocation/deallocation.  A global radix tree remains
      a good solution to this problem, but locking would have become the
      primary bottleneck after (upcoming) migration of chunk management from
      global to per arena data structures.
      
      This lock-free implementation uses double-checked reads to traverse the
      tree, so that in the steady state, each read or write requires only a
      single atomic operation.
      
      This implementation also assures that no more than two tree levels
      actually exist, through a combination of careful virtual memory
      allocation which makes large sparse nodes cheap, and skipping the root
      node on x64 (possible because the top 16 bits are all 0 in practice).
      8d0e04d4
    • Jason Evans's avatar
      Add (x != 0) assertion to lg_floor(x). · c810fcea
      Jason Evans authored
      lg_floor(0) is undefined, but depending on compiler options may not
      cause a crash.  This assertion makes it harder to accidentally abuse
      lg_floor().
      c810fcea
    • Jason Evans's avatar
      Refactor base_alloc() to guarantee demand-zeroed memory. · f500a10b
      Jason Evans authored
      Refactor base_alloc() to guarantee that allocations are carved from
      demand-zeroed virtual memory.  This supports sparse data structures such
      as multi-page radix tree nodes.
      
      Enhance base_alloc() to keep track of fragments which were too small to
      support previous allocation requests, and try to consume them during
      subsequent requests.  This becomes important when request sizes commonly
      approach or exceed the chunk size (as could radix tree node
      allocations).
      f500a10b
    • Jason Evans's avatar
      918a1a5b
    • Jason Evans's avatar
      Implement more atomic operations. · a55dfa4b
      Jason Evans authored
      - atomic_*_p().
      - atomic_cas_*().
      - atomic_write_*().
      a55dfa4b
    • Jason Evans's avatar
      Fix chunk_recycle()'s new_addr functionality. · 8ddc9329
      Jason Evans authored
      Fix chunk_recycle()'s new_addr functionality to search by address rather
      than just size if new_addr is specified.  The functionality added by
      a95018ee (Attempt to expand huge
      allocations in-place.) only worked if the two search orders happened to
      return the same results (e.g. in simple test cases).
      8ddc9329