From: Dan Magenheimer Subject: RE: [RFC] Scheduler work, part 1: High-level goals and interface. Date: Fri, 17 Apr 2009 08:55:32 -0700 (PDT) Message-ID: <1cd8b7d4-37bc-41c5-923d-c7bb3f565072@default> References: <49E8986A.6080806@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <49E8986A.6080806@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: George Dunlap , "Tian, Kevin" , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org > I think you're over-complicating it. Perhaps. Or maybe you are oversimplifying it? ;-) > At very worst, it will=20 > be no worse=20 > than the current situation where Xen will place the vcpus on=20 > threads/cores in more or less arbitrary ways. Agreed. Treating threads as cores is bad. Since that's what's happening today, one would think that any fix is better than nothing. > a contended HT thread is only worth, say, 70% of a > "real" core > : > (Another way to look at it is that HT contention is a bit like having=20 > your vcpu being preempted by Xen, but rather than going from 100%=20 > running to 0% running, your vcpu drops to 70%.) And that's the oversimplification I think. Just because Intel provides a rule-of-thumb that the extra thread increases performance by 30% doesn't mean that it is a good number to choose for scheduling purposes. I suspect (and maybe this has even already been proven) that this varies from 0%-100% depending on the workload, and may even vary from *negative* to *more* than 100%. (Yes, I understand that i7 is supposed to be better than the last round of HT... but is it always better?) Dan > -----Original Message----- > From: Jeremy Fitzhardinge [mailto:jeremy@goop.org] > Sent: Friday, April 17, 2009 8:56 AM > To: Dan Magenheimer > Cc: George Dunlap; Tian, Kevin; xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] [RFC] Scheduler work, part 1:=20 > High-level goals > and interface. >=20 >=20 > Dan Magenheimer wrote: > >> In any case, it's a bit like asking, "Why would I buy > >> a machine with two hyperthreads instead of two cores?" > >> =20 > > > > Yes. In a physical machine, the OS takes advantage of all > > resources available. So it doesn't matter if some of the > > "processors" are cores and some are hyperthreads. You > > are using ALL of the CPU resources you paid for. > > > > But in a virtualized environment, each VM gets a fraction > > of the resources and if grabbing some fixed number of > > "processors" sometimes gets hyperthreads and sometimes > > gets cores, this will cause interesting issues for some > > workloads. > > > > Think about a cloud where one pays for resources used. > > You likely would demand to pay less for a hyperpair than > > a non-vht pair. > > > > As a result, I think it will be a requirement that > > a system administrator be able to specify "I want two > > FULL cores" vs "I am willing to accept two hyperthreads". > > And once you get beyond hyperpairs, this is going to > > get very messy. > > =20 >=20 > I think you're over-complicating it. At very worst, it will=20 > be no worse=20 > than the current situation where Xen will place the vcpus on=20 > threads/cores in more or less arbitrary ways. >=20 > I think George's proposal can already accommodate the user=20 > needs you're=20 > talking about: >=20 > If the scheduler accounts for time spent executing on a contended HT=20 > thread (ie, the threads are not paired, so the other thread could be=20 > idle or running any other code) at a lesser rate than a full=20 > core/uncontended thread, then the charging works out. >=20 > If the user has a requirement that domain X's vcpus must be=20 > running at=20 > full speed, then they can set their reservation to 100%. If=20 > we say that=20 > a contended HT thread is only worth, say, 70% of a "real" core, then=20 > that not only factors into the charging, but also means that=20 > any domain=20 > with a reservation > 70% is ineligible to run on a contended=20 > HT thread. =20 > (I think in practise this means that any domain with high=20 > reservations=20 > will end up running on gang scheduled thread pairs, just to guarantee=20 > that the other thread is idle, so the uncontended HT thread=20 > can run at=20 > 100%.) >=20 > (Another way to look at it is that HT contention is a bit like having=20 > your vcpu being preempted by Xen, but rather than going from 100%=20 > running to 0% running, your vcpu drops to 70%.) >=20 > J >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >