Re: tcp proxy hackery

From: Adrian Chadd <adrian@dont-contact.us>
Date: Tue, 18 Mar 2008 11:00:20 +0900

On Tue, Mar 18, 2008, Henrik Nordstrom wrote:

> Does it? Most mallocs I know about has details about the allocated
> region just before the pointer (and optional red zone).

http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf

<quote>
   Small allocations are segregated such that each run manages a single size class. A region bitmap is
stored at the beginning of each run, which has several advantages over other methods:
   * The bitmap can be quickly scanned for the first free region, which allows tight packing of in-use
     regions.
   * Allocator data and application data are separate. This reduces the likelihood of the application
     corrupting allocator data. This also potentially increases application data locality, since allocator
     data are not intermixed with application data.
   * Tiny regions can be easily supported. This would be more difficult if, for example, a free list were
     embedded in the free regions.
</quote>

Both phkmalloc and jemalloc tried to avoid "cache thrashing" which involves
having to walk a sparse data structure resulting in a possible TLB/L2 cache miss
for each touch of the data structure.

Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -
Received on Mon Mar 17 2008 - 19:44:48 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:10 MDT