All of lore.kernel.org
 help / color / mirror / Atom feed
* How to migrate vCPUs based on Credit Scheduler
@ 2017-04-03 16:21 甘清甜
  2017-04-03 17:18 ` Lars Kurth
  0 siblings, 1 reply; 3+ messages in thread
From: 甘清甜 @ 2017-04-03 16:21 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1729 bytes --]

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!

[-- Attachment #1.2: Type: text/html, Size: 3785 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-04 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 16:21 How to migrate vCPUs based on Credit Scheduler 甘清甜
2017-04-03 17:18 ` Lars Kurth
2017-04-04 10:59   ` Dario Faggioli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.