All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Bob Chen <a175818323@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEMU -smp paramater: Will multiplue threads and cores improve performance?
Date: Wed, 21 Dec 2016 11:33:41 +0000	[thread overview]
Message-ID: <20161221113341.GB2498@redhat.com> (raw)
In-Reply-To: <20161221112342.GE9482@stefanha-x1.localdomain>

On Wed, Dec 21, 2016 at 11:23:42AM +0000, Stefan Hajnoczi wrote:
> On Wed, Dec 21, 2016 at 04:44:08PM +0800, Bob Chen wrote:
> > -smp 16
> > 
> > -smp cores=4,threads=4,sockets=1
> > 
> > 
> > Which one has better performance? The scenario is guest VMs running on
> > cloud server.
> 
> It's more complicated than that.
> 
> The CPU topology (cores, threads, sockets) can be used by guest kernels
> to make scheduling decisions.

cores vs sockets will have little difference, but cores or sockets
vs threads will definitely affect guest schedular.

> If you pin vcpu threads to host cpus and configure the guest with
> an accurate CPU topology then you can expect the guest kernel to make
> the best decisions.
> 
> If you do not pin vcpu threads then you cannot expect any consistent
> performance advantage by specifying the CPU topology.

In fact if you do not pin threads and you specify a CPU topology that
has > 1 hyperthread, you may well make performance of the guest worse.

Essentially you never want to use threads>1, unless pinning guest CPUs
to host CPUs 1:1

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

      reply	other threads:[~2016-12-21 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  8:44 [Qemu-devel] QEMU -smp paramater: Will multiplue threads and cores improve performance? Bob Chen
2016-12-21 11:23 ` Stefan Hajnoczi
2016-12-21 11:33   ` Daniel P. Berrange [this message]

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=20161221113341.GB2498@redhat.com \
    --to=berrange@redhat.com \
    --cc=a175818323@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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.