From: Keir Fraser Subject: Re: [PATCH] Fix BUG in alloc_heap_pages Date: Mon, 25 Sep 2006 16:02:53 +0100 Message-ID: References: <20060925144819.GA7793@kvasir.watson.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060925144819.GA7793@kvasir.watson.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Amos Waterland , xen-devel@lists.xensource.com Cc: Jimi Xenidis , Hollis Blanchard List-Id: xen-devel@lists.xenproject.org On 25/9/06 15:48, "Amos Waterland" 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