From: Dan Magenheimer Subject: RE: [PATCH] use tlsf for xmalloc engine Date: Thu, 16 Oct 2008 07:07:10 -0700 (PDT) Message-ID: <36fb634f-a46b-4efe-9d5c-711e1d0d1594@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "Xen-Devel (E-mail)" Cc: Diwaker Gupta , Isaku Yamahata , Nitin Gupta , kurt.hackel@oracle.com List-Id: xen-devel@lists.xenproject.org > Checked in as c/s 18638. Excellent! However, I should have mentioned that I had a reason for exposing the tlsf-direct (non-xmalloc) interface, which you have hidden by static'izing some of the routines and removing xmalloc_tlsf.h: The pool capability can be used to "group" allocated pages so as to improve locality and reduce fragmentation (kind of similar to slab/slub but across a wide range of allocation sizes). IOW, if I want to allocate a large and diverse set of data structures of types X, Y, and Z, and I can "partition" them into pools A, B, and C, I should get fewer page translation misses when I walk the A-specific data structures than if the allocations are all done via xmalloc. Further, if I free all of A's data structures, all the pages will be returned to the free page pool, whereas if I use xmalloc/xfree, B's and C's allocations will be intermingled so many/most pages may not be freed. Since you've retained the getmem/putmem function parameters and struct pool parameter, this should be easy to patch later, but please don't specialize it further to meet only xmalloc's needs as I intend to use pools in my current project (hcache). Thanks, Dan > -----Original Message----- > From: Keir Fraser [mailto:keir.fraser@eu.citrix.com] > Sent: Thursday, October 16, 2008 4:12 AM > To: Dan Magenheimer; Xen-Devel (E-mail) > Cc: Diwaker Gupta; Isaku Yamahata; Kurt Hackel; Nitin Gupta > Subject: Re: [Xen-devel] [PATCH] use tlsf for xmalloc engine >=20 >=20 > On 15/10/08 22:03, "Dan Magenheimer"=20 > wrote: >=20 > > This patch replaces the Xen xmalloc engine with tlsf, an allocation > > engine that is both more space efficient and time-bounded,=20 > especially > > for allocation sizes between PAGE_SIZE/2 and PAGE_SIZE. > >=20 > > The file xmalloc.c is deprecated but not yet deleted. A simple > > switch of a comment line in common/Makefile will change back > > to the legacy xmalloc/xfree if needed for testing. >=20 > Fixed for style, fixed to satisfy requested alignment parameter to > xmalloc(), and fixed for multi-page allocations to include the > BHDR_OVERHEAD. Checked in as c/s 18638. >=20 > -- Keir >=20 >=20 >