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/
Home Products Support Community News


[Xen-devel] Question about the Xen Scheduler

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Question about the Xen Scheduler
From: "Girish V" <girish.xen@xxxxxxxxx>
Date: Tue, 2 Sep 2008 13:32:45 -0400
Delivery-date: Tue, 02 Sep 2008 10:33:09 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=bE9nTifBwTQfutKIbZFkOpht10ZNREN2gIHRRWn+FIw=; b=xTmN2qQi6ZWx7u3TzP0g+lmQfht88ZFcTVeYA0DbqAOY3IYZWHWlVB1O4zk39omDTn /MwGCGMbbzqZf9RnD5+sqZMOgwyCvruprvkdsrlY1DTYKiIfOPb/xkRnA55xUQYtpBoQ /6RXirgUein7NmIGzIEl2zy0uA8t/NHY8kRcU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=BKJxnzupb/gpvThYl+K0CH/jIBRZ207J6mylRzULV8hzsXw/GrdFBJbBlPN2qwTlRc wM8YqYF+kLhfCeuRAnpG73Om925q5PQxFHGSbGZlyksGZnA5v5FeuQe6Vq4NtitFH5lg xpfttzWzvMCFpHcSKNPXaESmpeLUKYN44cr/o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I am trying to understand the behavior of the Xen scheduler. I am
using Xen 3.0.2 on a 1 CPU machine and I have the default scheduler
(which I believe is the credit scheduler - and I have not explicitly
set any weights/caps for the domains).

I have added printk's to the scheduler function (__enter_scheduler() )
just above the context_switch statement to indicate which domain is
getting de-scheduled and which domain is getting scheduled.

After booting dom0, I have created a dom5 (using a disk image and the
same unified kernel that is used for booting the dom0).

I do the following experiments.

1) First I boot up the dom0. No tasks are running on this domain. I
look at the printk messages - I see that the context switch happens
between dom0 and domain -1. From reading the mailing lists, I see that
-1 is the "idle" domain. (Is this an analogue of the idle process
pid=0 in Linux?) Also I am assuming that this idle domain does not use
a memory space (ie.) when there is a context switch between dom0 and
idle domain there is no re-writing of cr3 and hence no tlb flushing
etc - is this right?

2) Then I run a spec CPU workload (gzip which uses almost 100% of the
CPU) on dom0. Looking at the printks, I still see that domain
switching occurs between dom0 and idle domain. If the dom0 has need of
the cpu in the next scheduling timeslot and no-one is competing for
the cpu (both of which are satisfied in the described case) shouldn't
the dom0 itself be scheduled every time. Why does the idle domain get

3) I kill the spec workload on dom0 and boot up a dom4 with the same
kernel used for dom0 and a disk image as hda. Once the dom4 is
created, I run gzip on dom4 and no task on dom0. Looking at the
printks I see that there are dom switches from 0->4 and 4->0. I also
observe that 0->idle domain and 4->idle domain and idle domain->0/4
switches also happen.

4) Then I run a gzip on dom0 also. Now I see that dom4 *never* gets
scheduled (I ran the workload for almost one minute wall clock time).
The only dom switches are between dom0 and idle domain. If both the
dom0 and dom4 have equal share of the cpu (since I have not specified
otherwise) shouldn't the dom4 also be scheduled? Am I missing

I would really appreciate it if someone can shed some light on these questions.


Xen-devel mailing list

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