Re: MemPools rewrite

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Wed, 18 Oct 2000 22:51:58 +0200

On 18 Oct 2000, at 14:34, Alex Rousskov <rousskov@measurement-factory.com> wrote:

> On Wed, 18 Oct 2000, Andres Kroonmaa wrote:
>
> > While thinking of ways to optimise memPools I started to write down how
> > its done today and how it could look like. While doing so I came to one
> > solution, and as it was quite simple to convert my notes for a general
> > description I thought I would through it to squid-dev for review.
>
> Your design is actually very close to the initial mempool design that
> was killed (for various reasons) before it was committed to Squid source

 seems that I've missed that train. Why was it killed?

> tree :). I just want to note that you must be careful when giving out
> objects from a chunk -- some objects on some OSes require 8-byte,
> 16-byte, and other special alignments. It is possible to guarantee
> alignment within chunks, but we must not forget that gotcha while chunk
> handling is optimized. Standard malloc always returns memory with
> "maximum alignment" required, of course.

 this alignment is one of the major sources of memory waste. This is
 a must for general purpose allocator I guess, but inside squid? Do we
 have any places where 8/16 byte alignment is really required?
 I think we could add alignment value to MemPool struct or add another
 interface to memPoolCreate where we simply specify and round up
 requested size to given alignment requirement. Or we can round up this
 size with current api during a call to PoolCreate.

 I would like to align chunks on page boundaries, but I'd rather not
 hardwire 8/16 alignment into all object allocations.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Wed Oct 18 2000 - 14:55:23 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:51 MST