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

[Xen-devel] How to migrate a VCPU?



Hi, all.
I am recently trying to implement a global EDF scheduler. What I have done is inserting VCPUs in a queue(sorted by deadline), which is stored in a structure pointed by ops->sched_data. So all CPUs have access to this queue and fetch a VCPU to run.
Then I am going to describe my trouble. When dom0 boots. It has 4 VCPUs(v0, v1, v2, v3), By default each of them are assigned to one PCPU(p0, p1, p2, p3), as v(i)->processor = p(i). However, actually the VCPU is not executed by corresponding PCPU because all the 4 VCPUs are in a globle EDF queue. I mean one VCPU can be fetched by any of these PCPUs. The v->processor is meaningless here.
My console gets the printk information:
ÂRUNQ:-->[0:1][s:0ms][c:0ms][d:236ms]-->[0:2][s:0ms][c:0ms][d:238ms]-->[0:3][s:0ms][c:0ms][d:241ms]
(v0 of dom0 has been fetched by p0. So it is not in the RUNQ. And now v0 runs out of its time. p0 wants to get another VCPU. So it fetches v1 of dom0)
My scheduler returns a VCPU(v1). Before that I modified something of v1 like v1->processor=p0. ret.task->migrate=1. I don't know if it is necessary. I just modified these values as what i've seen in sched_credit.c. But when p0 changes to run v1, system crashed.
I don't know why. VCPU of dom0 can not be migrated?

Best regards.
Haofeng Hua

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

 


Rackspace

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