Haitao Shan
2011-Mar-01 07:55 UTC
[Xen-devel] [Patch] Add comments of code restrictions inside play_dead()
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@intel.com>
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();
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel