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

[Xen-devel] [Patch] Add comments of code restrictions inside play_dead()


  • To: Keir Fraser <keir@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Haitao Shan <maillists.shan@xxxxxxxxx>
  • Date: Tue, 1 Mar 2011 15:55:36 +0800
  • Cc:
  • Delivery-date: Mon, 28 Feb 2011 23:56:16 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=EtkaPbCz8yEHXojqerdlu2MIJMH3QHiq49yCQ5oFzGPxGximtlraOXMBlYtIfm+i1E WbK4ju7PBDHGcEm0NPTV/v2Nm9fPVSOteZdV//egYyaS3+dsGQd0yTIRElwpifGT5Grn kAA7AvjLrzPZT+p01tFAunPoLsGr802E9Ngik=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

This patch adds comments inside play_dead. This can be served as a notice
to developers who will add code to this code path.

Signed-off-by: Shan Haitao <haitao.shan@xxxxxxxxx>

diff -r c5d121fd35c0 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c Mon Feb 28 16:55:20 2011 +0000
+++ b/xen/arch/x86/domain.c Tue Mar 01 16:03:40 2011 +0800
@@ -99,6 +99,14 @@ static void default_dead_idle(void)
 
 static void play_dead(void)
 {
+    /*
+     * Important note:
+     *   After cpu_exit_clear, one can never assume per cpu variables are
+     * still accessable. Otherwise, #PF will happen. For example, calling to
+     * printk() will involve tasklet scheduling ,which also touches per cpu
+     * variables.
+     * Consider more carefully when adding code to this path.
+     */
     cpu_exit_clear(smp_processor_id());
     mb();
     local_irq_disable();

Attachment: add_warning_comment_for_play_dead.patch
Description: Binary data

_______________________________________________
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®.