WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] reduce time-slice for a specific VM

To: David Xu <davidxu06@xxxxxxxxx>
Subject: Re: [Xen-devel] reduce time-slice for a specific VM
From: George Dunlap <dunlapg@xxxxxxxxx>
Date: Mon, 27 Jun 2011 11:16:26 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
Delivery-date: Mon, 27 Jun 2011 03:17:34 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CbvUcmFMraeojda5o+S7ChMxjleEPpHiSNmIyW/hPto=; b=mkh8B/Ap9tBmtExnn3x5VRUL/oWH9a1yphLPlTaJBbTRhgJugp3xMzRHiBb2Am0T4i M32ltgCkrzu7iLeckXQHwM0JEj3Ic2rwtA8lPA9zogv9kb1D/cufbiWS9A9bOah5a6uW qW5ls4Rm8toyYW+yn1X8leVZmsEvp7A7dzbNc=
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 :content-transfer-encoding; b=M2ZCJYWqQpuFkQX3HqpL+S3kej9yhr5DOwQIK3AbVce9skz801UyPD44zkFVclx0Ba mQkFYdRtps0RhIWXiuvzpnIQk7mefNu2G4FXd6qLaixFd5N02f4uHI8R6QomHH6e+LOF P+mIPFX1xGxcXLfqmISnN+KP1U2va9kmkEG2Q=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BANLkTimYbuLADRiDgY8fSpRi+FMNBzX0fA@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTimYbuLADRiDgY8fSpRi+FMNBzX0fA@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sat, Jun 25, 2011 at 5:17 PM, David Xu <davidxu06@xxxxxxxxx> wrote:
> 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:

> 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.

> 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

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

<Prev in Thread] Current Thread [Next in Thread>