From: gavin Subject: Re: A question on the credit scheduler Date: Fri, 16 Dec 2011 22:44:54 +0800 (CST) Message-ID: <676b608e.2fb26.13447553671.Coremail.gbtux@126.com> References: <26c93838.3b3fb.13445de0e67.Coremail.gbtux@126.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9007817294162305594==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============9007817294162305594== Content-Type: multipart/alternative; boundary="----=_Part_551282_1275005648.1324046694000" ------=_Part_551282_1275005648.1324046694000 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit At 2011-12-16 19:04:19,"George Dunlap" wrote:>2011/12/16 zhikai : >> Hi All, >> >> In the credit scheduler, the scheduling decision function csched_schedule() >> is called in the schedule function in scheduler.c, such as the following. >> next_slice = sched->do_schedule(sched, now, tasklet_work_scheduled); >> >> But, how often the csched_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 wakes 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. Thank you very much for your reply. So, the vcpu is very likely to be preempted whenever the SCHEDULE_SOFTIRQ is raised. And we cannot find a small timeslice, such as a(ms), which makes the time any vcpu spending on running phase is k*a(ms), k is integer here. There is no such a small timeslice. Is it right? Best Regards, Gavin > > -George > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel ------=_Part_551282_1275005648.1324046694000 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit
At 2011-12-16 19:04:19,"George Dunlap" <George.Dunlap@eu.citrix.com> wrote:
>2011/12/16 zhikai <gbtux@126.com>:
>> Hi All,
>>
>> In the credit scheduler, the scheduling decision function csched_schedule()
>> is called in the schedule function in scheduler.c, such as the following.
>> next_slice = sched->do_schedule(sched, now, tasklet_work_scheduled);
>>
>> But, how often the csched_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 wakes 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.

Thank you very much for your reply.
So, the vcpu is very likely to be preempted whenever the SCHEDULE_SOFTIRQ is raised. And we cannot find a small timeslice, such as a(ms), which makes the time any vcpu spending on running phase is k*a(ms), k is integer here. There is no such a small timeslice. Is it right?

Best Regards,
Gavin

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


------=_Part_551282_1275005648.1324046694000-- --===============9007817294162305594== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============9007817294162305594==--