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] Fix BUG in alloc_heap_pages

To: Amos Waterland <apw@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix BUG in alloc_heap_pages
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 25 Sep 2006 16:02:53 +0100
Cc: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, Hollis Blanchard <hollisb@xxxxxxxxxx>
Delivery-date: Mon, 25 Sep 2006 08:01:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060925144819.GA7793@xxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acbgs6zU66kLV0ymEdu+jgAX8io7RQ==
Thread-topic: [Xen-devel] [PATCH] Fix BUG in alloc_heap_pages
User-agent: Microsoft-Entourage/11.2.5.060620
On 25/9/06 15:48, "Amos Waterland" <apw@xxxxxxxxxx> wrote:

> I believe that the failing sequence is that when alloc_heap_pages
> happens to exhaust a zone list and does a list_del on the last element
> and returns, and then the next call to the same function looks through
> the same list and decides that it is not empty and tries to do a
> list_del, which triggers the BUG I am seeing.

Deleting the last item from a list using list_del() leaves the list in a
well-defined state. list_empty() will return TRUE for the list.

> This patch is based on a suggestion by Jimi Xenidis, and it does indeed
> fix the problem on my blade.  I have walked through the code and have
> mostly convinced myself that there are no negative side effects of
> calling list_del_init, but I would appreciate any comments.

list_del_init() initialises the node that is deleted from the list, not the
list itself. Initialising the node to be a new empty list should not be
necessary -- callers to alloc_heap_pages() should not rely on the list-node
pointers being in any way valid.

 -- Keir



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

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