WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] use tlsf for xmalloc engine

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] use tlsf for xmalloc engine
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 16 Oct 2008 07:07:10 -0700 (PDT)
Cc: Diwaker Gupta <dgupta@xxxxxxxxxxx>, Isaku Yamahata <yamahata@xxxxxxxxxxxxx>, Nitin Gupta <nitingupta910@xxxxxxxxx>, kurt.hackel@xxxxxxxxxx
Delivery-date: Thu, 16 Oct 2008 07:09:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C51CD1ED.28239%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxx]
> 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
> 
> 
> On 15/10/08 22:03, "Dan Magenheimer" 
> <dan.magenheimer@xxxxxxxxxx> wrote:
> 
> > This patch replaces the Xen xmalloc engine with tlsf, an allocation
> > engine that is both more space efficient and time-bounded, 
> especially
> > for allocation sizes between PAGE_SIZE/2 and PAGE_SIZE.
> > 
> > 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.
> 
> 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.
> 
>  -- Keir
> 
> 
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>