From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: A question on the credit scheduler Date: Fri, 16 Dec 2011 11:04:19 +0000 Message-ID: References: <26c93838.3b3fb.13445de0e67.Coremail.gbtux@126.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <26c93838.3b3fb.13445de0e67.Coremail.gbtux@126.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: zhikai Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 2011/12/16 zhikai : > Hi All, > > In the credit scheduler, the scheduling decision function=A0csched_schedu= le() > is called in the schedule function in scheduler.c, such as the following. > next_slice =3D sched->do_schedule(sched, now, tasklet_work_scheduled); > > But, how often the=A0csched_schedule() is called and to run? Does this > frequency have something to do with the slice of credit scheduler that is > 30ms? The scheduler runs whenever the SCHEDULE_SOFTIRQ is raised. If you grep through the source code fro that string, you can find all the places where it's raised. Some examples include: * When the 30ms timeslice is finished * When a sleeping vcpu of higher priority than what's currently running wak= es up * When a vcpu blocks * When a vcpu is migrated from one cpu to another 30ms is actually a pretty long time; in typical workloads, vcpus block or are preempted by other waking vcpus without using up their full timeslice. -George