Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 2002 00:17:28 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, Poul-Henning Kamp <phk@critter.freebsd.dk>, Julian Elischer <julian@elischer.org>, arch@FreeBSD.ORG
Subject:   Re: Slab allocator update
Message-ID:  <20020302081728.GR77980@elvis.mu.org>
In-Reply-To: <20020301232155.N43446-100000@mail.chesapeake.net>
References:  <200203020355.g223tOn49150@apollo.backplane.com> <20020301232155.N43446-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* Jeff Roberson <jroberson@chesapeake.net> [020301 20:27] wrote:
> On Fri, 1 Mar 2002, Matthew Dillon wrote:
> 
> >
> >     It might be beneficial to introduce two versions of your free function,
> >     one which does not require the size and another, faster version which
> >     does, and then slowly adjust the kernel to use the new function as well
> >     as add sanity checks for INARIANTS to ensure we don't accidently leak
> >     or corrupt memory by specifying the wrong size.
> >
> > 						-Matt
> >
> I would love to do this, but I thought I'd encounter too much friction.
> Implementing this would remove the special cases for malloc, and I could
> implement more memory effecient slab formats.  Specifying the wrong size
> would cause you to try to free to the wrong zone, which uma can catch
> easily.
> 
> Assuming everyone agrees with this, I'll do it after the initial version
> is checked in and tested.

What the hell?

Why isn't there a pointer per page or PAGE_SIZE*N that points to
the bucket?  This is a simple space/speed tradeoff that we want
to make for speed.  With that in place all you need to do is
round down the Free'd location to the nearest page_size and
do a lookup into the perfect hash for that page.

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020302081728.GR77980>