reduce time-slice for a specific VM
Hi,
I want to reduce the time-slice of vCPUs of a specific VM or a kind of VMs. Do you have some good methods besides registering another timer? BTW, I plan to adjust the scheduling policy according to pending interrupts, how should I do? Is there some interface which can help me to look into the pending interrupts for every vCPU? Thanks.
Regards,
Cong
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 1 line · David Xu
Hi,
Hi David, I'm glad you're trying to contribute to Xen. Just so you know, one of the necessary skills in working on a big project like this is learning how to trace through the source code and figure out what's happening on your own. Even those of us who have been working with Xen for years don't know every part of it, and often have to do the same thing ourselves when we're looking at a part of the code we haven't seen before. (Or if it's particularly complicated, even if it's something we've worked with a lot but haven't touched in 6 months.)
Just giving you the answers ultimately won't be helping you learn this skill. But it is very difficult at first, when you have absolutely no idea where stuff is. So I'll try to help point you in the right direction, but you'll still have to try to figure most of it out yourself. Ultimately that will help you become a more mature programmer.
Two things that can help are ctags/gtags (google this), and a form of recursive grep. You can either use "rgrep" which will search all files in a subdirectory tree, or my formula:
$ find . -name "*.[cSh]" | xargs grep -H [whatever]
Hope that helps. Now to your specific questions:
Quoted 2 lines
I want to reduce the time-slice of vCPUs of a specific VM or a kind of VMs. Do you have some good methods besides registering another timer?
Your pluggable scheduler tells the Xen generic scheduler not only which vcpu to run, but how long to run it. Look at the return value of csched_schedule() in sched_credit.c and sched_credit2.c.
Quoted 4 lines
BTW, I
plan to adjust the scheduling policy according to pending interrupts, how should I do? Is there some interface which can help me to look into the pending interrupts for every vCPU? Thanks.
Whenever an event or interrupt is delivered to a vcpu, it calls schedule.c:vcpu_unblock(). There is currently no callback to notify the generic scheduler, but if you think that would be helpful, you could add one.
If there is an unhandled interrupt on a vcpu, vcpu_info(v, evtchn_upcall_pending) will be set.
Hope that helps.
-George
Hi George,
Sorry to truble you so much. I am studying the xen source code and I will try to avoid asking you directly about the sourcecode. Recently, I changed the scheduler letting Xen schedule latency-sensitvie VM frequently (insert it to the head of runqueue) while shorten the timeslice of latency-sensitive VM. This method can really reduce the shcedule latency for a specific VM and does not introduce much overhead to other VMs if I set timeslice of the latency-sensitive VM to a suitable value. Now, I want to associate a event as a trigger to my modified scheduler and make it work on-demand. Pending interrupt is a good choice. But I think pending interrupt just means there is a I/O request which may not be for a latency-sensitive application. So do you have some good idea on how to distinguish the latency-sensitive I/O interrupt from the others? Thanks.
Regards,
Cong
2011/6/27 George Dunlap <[email protected]>
Quoted 45 lines · David Xu
Quoted 1 line
Hi,
Hi David, I'm glad you're trying to contribute to Xen. Just so you know, one of the necessary skills in working on a big project like this is learning how to trace through the source code and figure out what's happening on your own. Even those of us who have been working with Xen for years don't know every part of it, and often have to do the same thing ourselves when we're looking at a part of the code we haven't seen before. (Or if it's particularly complicated, even if it's something we've worked with a lot but haven't touched in 6 months.)
Just giving you the answers ultimately won't be helping you learn this skill. But it is very difficult at first, when you have absolutely no idea where stuff is. So I'll try to help point you in the right direction, but you'll still have to try to figure most of it out yourself. Ultimately that will help you become a more mature programmer.
Two things that can help are ctags/gtags (google this), and a form of recursive grep. You can either use "rgrep" which will search all files in a subdirectory tree, or my formula:
$ find . -name "*.[cSh]" | xargs grep -H [whatever]Hope that helps. Now to your specific questions:
Quoted 1 line
I want to reduce the time-slice of vCPUs of a specific VM or a kind of
VMs.
Quoted 1 line
Do you have some good methods besides registering another timer?
Your pluggable scheduler tells the Xen generic scheduler not only which vcpu to run, but how long to run it. Look at the return value of
csched_schedule()insched_credit.candsched_credit2.c.Quoted 4 lines
BTW, I
plan to adjust the scheduling policy according to pending interrupts, how should I do? Is there some interface which can help me to look into the pending interrupts for every vCPU? Thanks.Whenever an event or interrupt is delivered to a vcpu, it calls schedule.c:vcpu_unblock(). There is currently no callback to notify the generic scheduler, but if you think that would be helpful, you could add one.
Quoted 7 lines
If there is an unhandled interrupt on a vcpu,
vcpu_info(v, evtchn_upcall_pending)will be set.Hope that helps.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel