[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Bug in xmalloc_bytes()



Keir,

Dan Magenheimer said I should forward this on to you, last week, as he was out. 
I meant to do some further testing against the top of xen-unstable, but 
something came up and I can't deal with this, further, right now. I'm sending 
my patch, as-is, so people can be aware of the bug.

John Byrne
 

-----Original Message-----
From: Byrne, John (HP Labs) 
Sent: Tuesday, October 13, 2009 6:32 PM
To: 'dan.magenheimer@xxxxxxxxxx'
Subject: Bug in xmalloc_bytes()

Dan,

Since you ported the xmalloc_tlsf code, I thought I'd talk to you first.

With the various roundings, xmalloc_bytes() fails consistently with requests of 
3921 to 3952 bytes.

3921 + 128 (SMP_CACHE_BYTES)- 16 (MEM_ALIGN) = 4033 in _xmalloc(); then 
MAPPING_SEARCH() rounds the size up to 4096, at which point you fail the "if ( 
size > (pool->grow_size - 2 * BHDR_OVERHEAD) )" test in xmem_pool_alloc().

Attached is the patch I came up with. I've tested it against:

changeset:   19105:696351cde9a4
user:        Keir Fraser <keir.fraser@xxxxxxxxxx>
date:        Wed Jan 28 16:58:41 2009 +0000
summary:     Allow memflags to be specified to alloc_xenheap_pages().

Not the latest stuff with the tmem hooks, but I don't think they will affect 
anything.

Feel free to test, fold, spindle, or mutilate it and/or send it on to Keir.

John





Attachment: tlsf.patch
Description: tlsf.patch

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.