From: Keir Fraser Subject: Re: Fwd: Xen scheduler Date: Sat, 17 Jun 2006 11:42:18 +0100 Message-ID: <70c2d02deb3e75e333d404e3224ceb2a@cl.cam.ac.uk> References: <4492CD25.E57C.0030.0@novell.com> <44931805.E57C.0030.0@novell.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: multipart/mixed; boundary=Apple-Mail-1-435046534 Return-path: In-Reply-To: <44931805.E57C.0030.0@novell.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: Ky Srinivasan Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Apple-Mail-1-435046534 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed I just applied the following patch to xen-unstable to make SEDF a bit saner. With this I can't get it to hog the CPU 100% like I could before. -- Keir --Apple-Mail-1-435046534 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0664; name="sedf.patch" Content-Disposition: attachment; filename=sedf.patch # HG changeset patch # User kaf24@firebug.cl.cam.ac.uk # Node ID ef8cdd1dc8360e310423a599ff1da76fb111bc96 # Parent b025491f0ba8ccb9e383379d914fb5ed5ca3ab69 [SEDF] Fix SEDF defaults to make domain0 take only a fair equally-weighted share of extratime. Also, hack the short- blocking logic as otherwise domain0 steals all CPU time for several seconds after waking from a long sleep. Signed-off-by: Keir Fraser diff -r b025491f0ba8 -r ef8cdd1dc836 xen/common/sched_sedf.c --- a/xen/common/sched_sedf.c Sat Jun 17 08:19:16 2006 +++ b/xen/common/sched_sedf.c Sat Jun 17 10:29:35 2006 @@ -360,24 +360,23 @@ INIT_LIST_HEAD(EXTRAQ(v->processor,EXTRA_UTIL_Q)); } + /* Every VCPU gets an equal share of extratime by default. */ + inf->deadl_abs = 0; + inf->latency = 0; + inf->status = EXTRA_AWARE | SEDF_ASLEEP; + inf->extraweight = 1; + if ( v->domain->domain_id == 0 ) { - /*set dom0 to something useful to boot the machine*/ + /* Domain0 gets 75% guaranteed (15ms every 20ms). */ inf->period = MILLISECS(20); inf->slice = MILLISECS(15); - inf->latency = 0; - inf->deadl_abs = 0; - inf->status = EXTRA_AWARE | SEDF_ASLEEP; } else { - /*other domains run in best effort mode*/ + /* Best-effort extratime only. */ inf->period = WEIGHT_PERIOD; inf->slice = 0; - inf->deadl_abs = 0; - inf->latency = 0; - inf->status = EXTRA_AWARE | SEDF_ASLEEP; - inf->extraweight = 1; } inf->period_orig = inf->period; inf->slice_orig = inf->slice; @@ -609,7 +608,16 @@ PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id, inf->short_block_lost_tot); +#if 0 + /* + * KAF: If we don't exit short-blocking state at this point + * domain0 can steal all CPU for up to 10 seconds before + * scheduling settles down (when competing against another + * CPU-bound domain). Doing this seems to make things behave + * nicely. Noone gets starved by default. + */ if ( inf->short_block_lost_tot <= 0 ) +#endif { PRINT(4,"Domain %i.%i compensated short block loss!\n", inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id); --Apple-Mail-1-435046534 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 17 Jun 2006, at 01:43, Ky Srinivasan wrote: > I had sent the following email to Kier and Ian earlier today. I think > this issue is important enough to have a wider discussion on this > topic. > K. Y > >>>> On Fri, Jun 16, 2006 at 3:23 PM, in message > <4492CD25.E57C.0030.0@novell.com>, > Ky Srinivasan wrote: >> Kier, >> >> In trying to narrow down the cause for domu's timeout problems, it > looks >> like we have a more serious problem in the xen scheduler. If you have > active >> load on dom0, all other domains get severely starved. A simple way to > see >> this is to have a process in an infinite loop on dom0 (for best > results have >> as many instances of this process running as the number of physical > CPUs on >> the box). With this load on dom0, all other domains will get little > or no cpu >> time. >> >> Looking at the sedf code, it looks like the default values do give a > lot of >> preference to dom0. What is the implication of setting domu's > scheduling >> parameters comparable to what dom0 gets. When I set domu's period and > slice >> values to what dom0 has, domu is getting a reasonable share of the > CPU. >> >> Regards, >> >> K. Y >> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --Apple-Mail-1-435046534 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 --Apple-Mail-1-435046534--