From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNkvg-0004Xt-Fg for qemu-devel@nongnu.org; Tue, 08 Nov 2011 07:37:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNkve-0007Dj-OB for qemu-devel@nongnu.org; Tue, 08 Nov 2011 07:37:28 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:52082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNkve-0007DX-Ju for qemu-devel@nongnu.org; Tue, 08 Nov 2011 07:37:26 -0500 Received: by iakk32 with SMTP id k32so530289iak.4 for ; Tue, 08 Nov 2011 04:37:26 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20111108120443.GA76806@cs.nctu.edu.tw> <20111108121056.GA96832@cs.nctu.edu.tw> Date: Tue, 8 Nov 2011 07:37:25 -0500 Message-ID: From: Xin Tong Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] multiprocessor on kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel , =?UTF-8?B?6Zmz6Z+L5Lu7?= so qemu exposes multiple processors to the guest os by having multiple vCPUs. and it realizes the multiple vCPUs by either using RR on a single host cpu (qemu ) or using multiple host cpus (kvm). Thanks Xin 2011/11/8 Stefan Hajnoczi : > On Tue, Nov 8, 2011 at 12:10 PM, =B3=AF=AD=B3=A5=F4 wrote: >> On Tue, Nov 08, 2011 at 08:04:44PM +0800, =B3=AF=AD=B3=A5=F4 wrote: >>> > I am wondering that when one uses qemu with kvm. How many cores are >>> > exposed and available to the guest os ( assuming the host has 4 cores >>> > ). is this configurable ? >>> >>> QEMU provides "-smp" option, but those virtual cpus are scheduled in >>> round-robin fashion. In other words, it's not real parallelism. I don't >>> know if there is any difference with kvm enabled. >> >> IIRC, kvm uses QEMU for device emulation only. Those virtual cpus are >> ran on physical cpus simultaneously. > > Right, qemu -enable-kvm will run a thread for each vCPU. So you get > true SMP parallelism. > > QEMU without KVM mode, on the other hand, does round-robin scheduling > of vCPUs and does not take advantage of multiprocessor hosts. > > Stefan >