From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Marco Antonio <spyke.me@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Credit Scheduler code question
Date: Fri, 20 Aug 2010 12:46:42 +0100 [thread overview]
Message-ID: <AANLkTik=NHDdM=k7xD-wrKBjxeAxc_FcsSY6PHOXu3Xs@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinopU1PDLW2wWuLmnN70v7-2ZsdTQ_M3w_ORKJ9@mail.gmail.com>
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
>
>
prev parent reply other threads:[~2010-08-20 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-19 18:05 Credit Scheduler code question Marco Antonio
2010-08-20 11:46 ` George Dunlap [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTik=NHDdM=k7xD-wrKBjxeAxc_FcsSY6PHOXu3Xs@mail.gmail.com' \
--to=george.dunlap@eu.citrix.com \
--cc=spyke.me@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).