xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Credit Scheduler code question
@ 2010-08-19 18:05 Marco Antonio
  2010-08-20 11:46 ` George Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Antonio @ 2010-08-19 18:05 UTC (permalink / raw)
  To: xen-devel


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

Hi,

I'm a PhD student trying to add some load balancing code to the credit
scheduler in order to fit some specific necessities. I'm trying to
understand the credit scheduler code and I don't quite get in which part of
it a pcpu starts running a vcpu. I need to keep track of when a vpcu starts
running in a cpu and when it stops. Any hint on that?

I think that it would also be helpfull to know how functions in the* struct
scheduler sched_credit_def* are called.

Thanks,

Marco.

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

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

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

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

* Re: Credit Scheduler code question
  2010-08-19 18:05 Credit Scheduler code question Marco Antonio
@ 2010-08-20 11:46 ` George Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2010-08-20 11:46 UTC (permalink / raw)
  To: Marco Antonio; +Cc: xen-devel

The generic schedule code is in common/schedule.c and
arch/x86/domain.c.  common/schedule/schedule() calls
common/sched_credit.c/csched_schedule() to ask which vcpu should be
scheduled next on the current pcpu.  At the bottom of that function,
it calls context_switch(), which can be found in arch/x86/domain.c.
__context_switch() in that same file does the register changing; and
schedule_tail() at the bottom of context_switch() is what will
actually jump back into the vcpu if necessary.

Does that help?

If you just want to see what vcpus are doing, you can use xentrace to
trace runstate-change events, and then use xenalyze to analyze them.

Xenalyze can be found here:
 http://xenbits.xensource.com/ext/xenalyze.hg

> I think that it would also be helpfull to know how functions in the struct
> scheduler sched_credit_def are called.

One thing that may help you to grok the source code is the following magic rune:
 $ find . -name "*.[cSh]" | xargs grep -H {something I'm looking for}

For example, you could have used this to search for "->do_schedule",
and found that it was only called from common/schedule.c:schedule().

You can use rgrep as well, but that doesn't allow you to focus on a
specific subset of files.  :-)

 -George

On Thu, Aug 19, 2010 at 7:05 PM, Marco Antonio <spyke.me@gmail.com> wrote:
> Hi,
>
> I'm a PhD student trying to add some load balancing code to the credit
> scheduler in order to fit some specific necessities. I'm trying to
> understand the credit scheduler code and I don't quite get in which part of
> it a pcpu starts running a vcpu. I need to keep track of when a vpcu starts
> running in a cpu and when it stops. Any hint on that?
>
>
> Thanks,
>
> Marco.
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>

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

end of thread, other threads:[~2010-08-20 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 18:05 Credit Scheduler code question Marco Antonio
2010-08-20 11:46 ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).