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

[Xen-bugs] [Bug 1616] CPU panic when running cpu offline



http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1616


yunhong.jiang@xxxxxxxxx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #2 from yunhong.jiang@xxxxxxxxx  2010-06-01 00:45 -------
For issue 2, CPU panic when running cpu offline, it should comes from the
periodic_timer.

When a CPU is pull down, cpu_disable_scheduler will remove the single shot
timer, but the periodic_timer is not migrated.
After the vcpu is scheduled on another pCPU later, and then schedule out from
that new pcpu, the stop_timer(&prev->periodic_timer) will try to access the
per_cpu strucutre, whic still poiting to the offlined CPU's per_cpu area and
will cause trouble. This should be caused by the per_cpu changes.

I try to migrate the periodic_timer also when cpu_disable_scheduler() and seems
it works. ï¼?comments the migration in cpu_disable_scheudler will trigger the
printk).
Seems on your side, the timer will always be triggered before schedule out?

--jyh

diff -r 96917cf25bf3 xen/common/schedule.c
--- a/xen/common/schedule.c     Fri May 28 10:54:07 2010 +0100
+++ b/xen/common/schedule.c     Tue Jun 01 15:35:21 2010 +0800
@@ -487,6 +487,15 @@ int cpu_disable_scheduler(unsigned int c
                 migrate_timer(&v->singleshot_timer, cpu_mig);
             }

+/*
+            if ( v->periodic_timer.cpu == cpu )
+            {
+                int cpu_mig = first_cpu(c->cpu_valid);
+                if ( cpu_mig == cpu )
+                    cpu_mig = next_cpu(cpu_mig, c->cpu_valid);
+                migrate_timer(&v->periodic_timer, cpu_mig);
+            }
+*/
             if ( v->processor == cpu )
             {
                 set_bit(_VPF_migrating, &v->pause_flags);
@@ -505,7 +514,10 @@ int cpu_disable_scheduler(unsigned int c
              * all locks.
              */
             if ( v->processor == cpu )
+            {
+                printk("we hit the EAGAIN here\n");
                 ret = -EAGAIN;
+            }
         }
     }
     return ret;
@@ -1005,6 +1017,11 @@ static void schedule(void)

     perfc_incr(sched_ctx);

+    if (prev->periodic_timer.cpu != smp_processor_id() &&
!cpu_online(prev->periodic_timer.cpu))
+    {
+        printk("I'm now at cpu %x, timer's cpu is %x\n", smp_processor_id(),
prev->periodic_timer.cpu);
+    }
+
     stop_timer(&prev->periodic_timer);

     /* Ensure that the domain has an up-to-date time base. */


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.