Re: sdirno/sfileno sizes

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Fri, 30 Mar 2001 16:06:54 +0200

On 30 Mar 2001, at 15:13, Henrik Nordstrom <hno@hem.passagen.se> wrote:

> Andres Kroonmaa wrote:
>
> > I hoped so too. But no. malloc aligns mmaped allocs to a page start.
> > And it always _prepends_ its overhead. Because it doesn't know the
> > alloc size at free() time, so it looks at front of it to find its
> > housekeeping. With a mmap this unavoidably means that any mmaped
> > alloc has a 1 page waste prepended... Requesting less gives nothing.
>
> Ah, well. Maybe I am confused about dlmalloc (do not use it very often).
>
> The GNU libc malloc I know behaves well.. (header at start of page,
> followed by allocation).

 hmm. funny. It doesn't provide eg. disk buffer page-aligned? OS would
 need to copy pages instead of using directly then...

> > > Yes. And as the number of pools are growing a lot in 2.5 with lots of
> > > small pools we probably want to decrease the lower limit to only a few
> > > kb.
> >
> > thats very easy with Tune function.
>
> if you can find a good place to do that tuning yes.. perhaps not that
> easy as most of those pools are hidden from the caller using macros
> (part of cbdata).

 Good place used to be exactly after memDataInit() call in mem.c:memInit()
 As good place should be after CREATE_CBDATA() in cbdata.c:cbdataInit() ??

> Probably easier to change the default to allow for small chunks, and
> then tune the ones needed to require bigger chunks.. or perhaps even use
> some dynamic approach where chunk sizes grows with population.

 Why we need small chunks? To avoid having pools with single chunk of 16K?
 Even if we had 100 pools with single item, we'd waste only 1.6M.

 I'd on contrary would try to use as large chunks as possible by default.

 Dynamic is not easy. I can't find a clean way how to change chunk size
 after some allocations have been serviced.
 But perhaps we could even shrink the chunk if we notice that it never
 exceeds few simultaneous allocations.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Fri Mar 30 2001 - 07:11:21 MST

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