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

[Xen-ia64-devel] xen_timer_interrupt: can someone explain the code ?



Hi,

I am currently enabling SMP guest using SMP host.
I have made some progresses, but I have just hit a barrier: I got a *lot* of
  Oops: timer tick before it's due

The good news is the message always appear and very frequently.  So it is time 
to fix it.

I have look on the xen_timer_interrupt function in xentime.c, but I don't 
really understand it.  The questions are before the statements:



What is the purpose of this statement ?
        if (current->domain == dom0) {
                // FIXME: there's gotta be a better way of doing this...
                // We have to ensure that domain0 is launched before we
                // call vcpu_timer_expired on it
                //domain0_ready = 1; // moved to xensetup.c
                VCPU(current,pending_interruption) = 1;
        }

Here dom0 is awaken if its timer has expired, correct ?
Why is dom0 special ? (and why only vcpu[0] ?)
        if (domain0_ready && current->domain != dom0) {
                if(vcpu_timer_expired(dom0->vcpu[0])) {
                        vcpu_pend_timer(dom0->vcpu[0]);
                        //vcpu_set_next_timer(dom0->vcpu[0]);
                        vcpu_wake(dom0->vcpu[0]);
                }
        }


This is the core job.
The only question is why vcpu_wake ?
        if (!is_idle_domain(current->domain))  {
                if (vcpu_timer_expired(current)) {
                        vcpu_pend_timer(current);
                        // ensure another timer interrupt happens even if 
domain doesn't
                        vcpu_set_next_timer(current);
                        vcpu_wake(current);
                }
        }
        new_itm = local_cpu_data->itm_next;

        if (!VMX_DOMAIN(current) && !time_after(ia64_get_itc(), new_itm))
                return;

Why current must be always awaken in VTI ?
        if (VMX_DOMAIN(current))
                vcpu_wake(current);


Thank you,
Tristan.


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


 


Rackspace

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