From owner-freebsd-arch Sat Mar 2 0:17:35 2002 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 886F537B405 for ; Sat, 2 Mar 2002 00:17:28 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 641E4AE2C3; Sat, 2 Mar 2002 00:17:28 -0800 (PST) Date: Sat, 2 Mar 2002 00:17:28 -0800 From: Alfred Perlstein To: Jeff Roberson Cc: Matthew Dillon , Poul-Henning Kamp , Julian Elischer , arch@FreeBSD.ORG Subject: Re: Slab allocator update Message-ID: <20020302081728.GR77980@elvis.mu.org> References: <200203020355.g223tOn49150@apollo.backplane.com> <20020301232155.N43446-100000@mail.chesapeake.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020301232155.N43446-100000@mail.chesapeake.net> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Jeff Roberson [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