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

Re: [Xen-devel] Credit Scheduler code question


  • To: Marco Antonio <spyke.me@xxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
  • Date: Fri, 20 Aug 2010 12:46:42 +0100
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 20 Aug 2010 04:49:13 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=SjHF18D+9tXZhi99+Y/Ne7aMNTClwatuYjaX5chZgP+Vd1IvdaWxhLzX0l2SJzML/y CAoK20J+bXRaC6Uxv2AV3wjf1e2PpABHZkRESBTvlQBMGFdDpHZ+pMAkIIVY6M1YOboZ KGOBi24jTy17zc86bgV7jbjd/wBzVf4QoWrNQ=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.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@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>

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


 


Rackspace

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