From: "Mike D. Day" Subject: Re: CPU scheduling of domains and vcpus Date: Mon, 21 Apr 2008 16:32:18 -0400 Message-ID: <20080421203218.GA14282@silverwood.ncultra.org> References: <1301abeb0804211052i2c498568ue1a761ae8a618029@mail.gmail.com> <20080421175630.GA6127@implementation> Reply-To: ncmike@us.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20080421175630.GA6127@implementation> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault , Nauman Rafique , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 21/04/08 18:56 +0100, Samuel Thibault wrote: > Hello, >=20 > Nauman Rafique, le Mon 21 Apr 2008 13:52:21 -0400, a =C3=A9crit : > > In fact, wasted cycles can probably be avoided by doing opportunisiti= c > > gang scheduling (i.e. gang schedule, unless there would be wasted > > cycles) >=20 > How do you detect that there would be wasted cycles? The only way is for a very self-aware guest to use a paravirtual feature to give a hint to the scheduler.=20 Which is also the way to solve the original problem: the paravirtualized guest can provide a hint to the scheduler that it is holding a contended lock. Alternatively, the scheduler can notify the guest that it is about to be preempted by the hypervisor and now would be a good time to sleep before gaining a contended spinlock. In either case lock contention within a multi-vcpu guest is probably not as bad a problem as the various solutions cause. If a workload is suffering so much, give it multiple vcpus that are mapped 1:1 to physical cpus.=20 Mike --=20 Mike D. Day IBM LTC Cell: 919 412-3900 Sametime: ncmike@us.ibm.com AIM: ncmikeday Yahoo: ultra.runner PGP key: http://www.ncultra.org/ncmike/pubkey.asc