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

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

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Bug in xmalloc_bytes()
From: "Byrne, John (HP Labs)" <john.l.byrne@xxxxxx>
Date: Wed, 21 Oct 2009 01:49:01 +0000
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 20 Oct 2009 18:50:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
Thread-index: AcpMbiGTpsosXvUZTBKfKN0tNBAdJAFgbqeQ
Thread-topic: [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
<Prev in Thread] Current Thread [Next in Thread>