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

[Xen-devel] How to migrate vCPUs based on Credit Scheduler



Hi,

 I'm now designing new vCPU scheduler in Xen, and trying to implement 
the scheduler based on the Credit scheduler in Xen-4.5.1. But I encountered
 come problems when debuging the code.

Most of the code modification is done in function csched_schedule() in 
file: xen/common/csched_schedule.c . And the core code is as followed:

if( vcpu_runnable(current) )
{
        if( match the migration contition )
        {
            cpu_affinity = pick_pcpu_runq();  // this function is defined by myself
            
            pcpulock = pcpu_schedule_lock_irqsave(cpu_affinity, 
                   &pcpulock_flag);

            TRACE_3D(TRC_CSCHED_STOLEN_VCPU, cpu_affinity  , domain_id,
                   vcpu_id);
            SCHED_VCPU_STAT_CRANK(scurr, migrate_q);
            SCHED_STAT_CRANK(migrate_queued);
            WARN_ON(scurr->vcpu->is_urgent);
        scurr->vcpu->processor = cpu_affinity;

             __runq_insert(cpu_affinity, scurr);
            pcpu_schedule_unlock_irqrestore(pcpulock, pcpulock_flag, cpu_affinity  );
        }
        else 
            __runq_insert(cpu, scurr);
}
else 
        BUG_ON( is_idle_vcpu(current) || list_empty(runq) );


I try to run the modified Xen. But according to the log I found that, 
although I insert the vCPU into the runqueue  of another pCPU, the 
vCPU still appears at the old pCPU in the following scheduling period. 
Now I have a few questions:

1. Does the Xen scheduler framework support changing the pCPU of a 
vCPU after using out the scheduling time slice, but not just to steal one 
vCPU from runqueue of other pCPU in load_balance period?

2. If yes, what status of the vCPU should be changed before inserting 
the vCPU into the destination pCPU?

Thank you very much!
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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