From: Mats Petersson <mats@planetcatfish.com>
To: pak333@comcast.net, Atsushi SAKAI <sakaia@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Credit scheduler
Date: Thu, 12 Jul 2007 22:25:23 +0100 [thread overview]
Message-ID: <46969c77.3e1f420a.7333.43d5@mx.google.com> (raw)
In-Reply-To: <071220072046.7704.4696931E000C3BAA00001E182207020953CCCCCC 050E9F@comcast.net>
At 21:46 12/07/2007, pak333@comcast.net wrote:
>Hi Atsushi
>
>I am still confused, so let me explain what i think should happen
>and understand from you why it may not happen.
>
>I have 2 cpu intensive VMs and 1 IO intensive VM. My system has 4
>physical cpus and 8 virtual cpus.
>
>Now using default parameters for the credit scheduler, the cpu
>intersive vcpu should run for 30 millsec. It does not, it runs for
>less (few microsecs).
>
>You said this could be because of softirq which are raised after a
>system call. Can i disable the softirqs. What happens if i do? If i
>cannot disable is there a way to see what VM is raising the softirq.
>If the cpu-VM raises the softirq it gets preempted or does it
>continue to run. How can I montior the softirqs raised by this VM.
>Can I tell if the premption is from a softirq or from something else.
I don't believe you can "disable" a softirq - you could of course
avoid doing the call to "do_softirq", but that is most likely just
going to completely remove any scheduling capability at all in the
system, making the system "single-tasking". Not a recommended way, in
my opinion.
>
>Also, if the IO VM requests an IO, it will block and dom0 wakes up
>and gets scheduled to run to service the IO. Will it preempt the cpu
>intensive VM. If so why? Shouldn't the cpuintensiveV M get its
>quantum of time.
>Or does the IOVM get higher priority to preempt the cpu intensive
>VM. How does the scheduler pick which cpu to run dom0 on ( if all
>the vcpus running are cpu intensive)? If there is a mix of cpu-vcpus
>and Io-vcpus, which will be the victim
The whole idea of having separate queues for IO and CPU intensive VMs
(or processes in a normal kernel scenario) is to allow the
IO-intensive tasks to avoid waiting for the next time-slot when a
CPU-hogging VM/process is running [1]. The normal behaviour for the
scheduler is to determine dynamically if the current VM/process is IO
or CPU intensive.
Unless Dom0 is used for doing some silly CPU-intensive task
(calculating PI with a million decimal points or compiling Xen +
Linux kernel, for example), it will most likely look to the scheduler
like a IO-intensive VM. So it will have the same priority as any
other IO-intensive VM (assuming Dom0 has equal scheduler parameters
as other guests, which I'm pretty sure is the default behaviour).
If, like in your example, there are a number of processors busy with
CPU-intensive tasks, and others with IO-intensive tasks, the most
likely scenario is that any new IO-request will go be run on a
"previously CPU-intensive" CPU - but on the other hand, if you have a
lot of IO-intensive processing, there should be some processor(s)
that are "asleep" - unless all CPU's are busy running CPU-intensive tasks...
Note that scheduling is a complex subject, and there have been dozens
of PhD dissertations written on the subject.
[1] The idea being that if we process the IO-request that just
completed, we can set up another IO-request, and this will get better
IO-throughput than waiting a long time (relatively speaking 30ms is
an eternity to the processor).
--
Mats
>
>As you see i have a lot of questions, so please bear with me and
>help me understand the scheduling behavior of Xen
>
>Thanks
>Prabha
>
>
>
>
>-------------- Original message --------------
>From: Atsushi SAKAI <sakaia@jp.fujitsu.com>
>
> > Hi Prabha
> >
> > Please check do_softirq in assembler.
> > for x86
> > call do_softirq
> > is in.
> >
> > And usually do_softirq is executed at the end of system call.
> >
> > Thanks
> > Atsushi SAKAI
> >
> >
> >
> > pak333@comcast.net wrote:
> >
> > > Thanks for the explanation, i am not sure i understood it correctly.
> > >
> > >
> > > when does softirq get set. So when softirq is set a processor enters the
> > scheduler every 3 micro secs? where in the source code is this
> handled. please
> > could you send me some pointers
> > >
> > > thanks
> > > -Prabha
> > >
> > >
> > >
> > >
> > > -------------- Or iginal message --------------
> > > From: Atsushi SAKAI
> > >
> > > > Hi,$B!!(BPrabha
> > > >
> > > > $B!!(B30msec is the maximum time slice.
> > > > And I guess your 3 microsecond is the response after
> > > > SCHEDULE_SOFTIRQ is set.
> > > > As you know,
> > > > If SCHEDULE_SOFTIRQ is set,
> > > > it waits softirq calls schedule(). (this time interval is 3microsec)
> > > >
> > > > And I/O intensive has higher priority than CPU intensive.
> > > > So I/O intensive job is first dispatched domain in runq.
> > > > This is because latency improvement for I/O intensive guest.
> > > >
> > > > So your behavior is not strange.
> > > >
> > > > Thanks
> > > > Atsushi SAKAI
> > > >
> > > >
> > > > pak333@comcast.net wrote:
> > &g
>t; >
> > > > > Hi
> > > > >
> > > > > I have noticed that VMs are typically spending 3 microsecs
> or less before
> > they
> > > > are being prempted. I thought that the credit schduler time
> slice was 30 ms.
> > I
> > > > have 4 VMs running and they are all cpu intensive except for
> 1 (which is IO
> > > > intensive) but having a VM spend max 3 micro secs before
> being kicked out
> > seems
> > > > strange.
> > > > >
> > > > > Is there something else going on that i am not aware of. Is
> the time slice
> > > > really 30 millisecs? I am using default parameters of the
> credit scheduler.
> > > > >
> > > > > Thanks
> > > > > -Prabha
> > > >
> > > >
> >
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen source.com
> > http://lists.xensource.com/xen-devel
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2007-07-12 21:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-12 20:46 Credit scheduler pak333
[not found] ` <071220072046.7704.4696931E000C3BAA00001E182207020953CCCCCC 050E9F@comcast.net>
2007-07-12 21:25 ` Mats Petersson [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-10-21 18:03 Lasya Venneti
2015-10-22 11:28 ` Dario Faggioli
2011-09-18 15:21 credit scheduler Pratik shinde
2011-09-19 15:53 ` George Dunlap
2011-06-17 14:48 David Xu
2011-06-21 14:04 ` George Dunlap
2009-06-04 17:38 Credit Scheduler gaurav somani
2009-06-23 7:56 ` Michael xin
2007-07-12 23:21 Credit scheduler pak333
2007-07-13 7:30 ` Atsushi SAKAI
2007-07-13 18:11 ` Mats Petersson
2007-06-27 5:15 pak333
2007-06-27 5:51 ` Atsushi SAKAI
2007-06-27 1:55 pak333
2007-06-27 11:04 ` Keir Fraser
2007-06-27 1:09 pak333
2007-06-27 1:17 ` Keir Fraser
2007-06-26 21:33 pak333
2007-06-27 0:59 ` Keir Fraser
2007-06-27 2:29 ` Atsushi SAKAI
2006-08-28 23:04 credit scheduler Ian Pratt
2006-08-28 22:28 Karl Rister
2006-08-29 6:16 ` Keir Fraser
2006-08-29 12:45 ` George Dunlap
2006-08-29 21:26 ` Sean Dague
2006-08-29 22:17 ` Emmanuel Ackaouy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46969c77.3e1f420a.7333.43d5@mx.google.com \
--to=mats@planetcatfish.com \
--cc=pak333@comcast.net \
--cc=sakaia@jp.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.