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] [Question] Is it safe to call "xmalloc()" with irq disabled?

To: Keir Fraser <keir@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [Question] Is it safe to call "xmalloc()" with irq disabled?
From: Haitao Shan <maillists.shan@xxxxxxxxx>
Date: Tue, 1 Mar 2011 15:42:54 +0800
Cc:
Delivery-date: Mon, 28 Feb 2011 23:43:51 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=y2IQZ6SXR2H8UJ0gwy46S04tVufQswcAXigvAYfsvXs=; b=KS12gJoxuoAIetCymEz8spo8NpBsdNHIqrGBpkoDeCWE26s39IInk1QU3NIW8I/ug7 K6mb9hGiBHRc5RkM5VDlwyoZDSHrQxI+cXAuyUiokEI+hS0BLWMXpfgMBn7giSs63vOs 6dq4RmrAGisP5n+Jrwmiugmw2EDugNIKt6eoo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=xKz48rX0MB+mvipQRLQ8K9liVmAgSD7TDGU/FmYK+Kio4na0jkXxJ67JgGY4cEQhrO GzQzWH7K5yA7G6y/dpzBd0Qyc1+5Yo5cH3dV80Df83OSkNw9oco8pZM4rDZxeWj29J2M bjJuLV95UReHQYa7QyIA5MjctHziNT1geUZ0s=
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
Hi, Keir,

In recent effort on debugging cpu offline/online, I met Xen panic some times.

The reason of the panic is caused by following code path:

xmalloc ---> alloc_heap_pages ---> flush_area_mask { ASSERT(local_irq_enabled)........}

This bring me the question: is it safe to call xmalloc with local irq disabled? As you can see, not all alloc_heap_pages will result in TLB flushing. But once it calls, the assertion will fail.

In my case, the xmalloc is called with starting secondary processors. Some initialization code run with local irq enabled, for example, the MCA initialization. Normally this piece of code runs when all heap pages do not have a former owner (no domain is initialized at booting time, I guess), so calling xmalloc won't be a problem. But later when this same piece of code runs as a result of cpu online operation, it has possibility to trigger the assertion failure.

What's you view on this, Keir? Is it the design that xmalloc must be called with local irq enabled? I have done a hack to remove the assertion. Every things work just fine to me. But maybe I just happened not to run into any problem with the hack.

Shan Haitao
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Question] Is it safe to call "xmalloc()" with irq disabled?, Haitao Shan <=