qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vl: rework smp_parse
Date: Fri, 7 Nov 2014 13:23:12 +0100	[thread overview]
Message-ID: <20141107122312.GA10985@hawk.usersys.redhat.com> (raw)
In-Reply-To: <20141107121606.GG3196@thinpad.lan.raisama.net>

On Fri, Nov 07, 2014 at 10:16:06AM -0200, Eduardo Habkost wrote:
> On Fri, Nov 07, 2014 at 12:21:26PM +0100, Andrew Jones wrote:
> > On Fri, Nov 07, 2014 at 10:52:31AM +0100, Andrew Jones wrote:
> > > On Fri, Nov 07, 2014 at 10:40:14AM +0100, Paolo Bonzini wrote:
> > > > 
> > > > 
> > > > On 07/11/2014 10:29, Andrew Jones wrote:
> > > > >> > I think this would cause too many failures in the wild.  Perhaps error
> > > > >> > out if it is lower, and warn if sockets * cores * threads > max_cpus
> > > > >> > since we actually allow hot-plug a thread at a time?
> > > > > We'd still have more failures if we choose to error out when it's lower,
> > > > > since we currently silently adjust threads in some of those cases, or
> > > > > just don't care that the topology doesn't support up to maxcpus in other.
> > > > 
> > > > So I guess we need a decent fallback if it doesn't match.  Something
> > > > like (based also on the reply from Eduardo):
> > > > 
> > > > 1) always warn if max_cpus % (cores*threads) != 0 || smp_cpus %
> > > > (cores*threads) != 0
> > > > 
> > > > 2) if sockets*cpus*threads < max_cpus, adjust sockets to
> > > > DIV_ROUND_UP(max_cpus, cores*threads).  If we didn't warn in step 1, do
> > > > it now.  Give a different, less harsh warning if the cmdline
> > > > sockets*cpus*threads did match smp_cpus.  In the latter case, the user
> > > > _almost_ knows what he was doing.
> > > > 
> > > > Not perfect, but it could be something to start from.  Adjusting sockets
> > > > is better than adjusting threads.
> > > 
> > > OK. I can whip up a v2 that is less harsh (more warnings, less aborts).
> > > I'll also address the other issue I mentioned in the bottom of my reply
> > > to Eduardo, which is to make sure we consider machine_class->max_cpus.
> > 
> > After talking with Igor, it seems like the better approach is to get
> > smp parameters converted over to machine properties, allowing us to
> > use the old parser for old machine types, and the new for new. I'll
> > look into it.
> 
> While we work on that, I think we could at least change the existing
> code to abort if sockets*cores*threads < smp_cpus (when all 4 options
> are present in the command-line), and never adjust any option silently.

But then we'll end up with 3 different behaviors. If we do anything for
the short-term, then maybe it should only be to add warnings. The
machine property version will then convert those warnings to aborts for
new machines types.

drew

  reply	other threads:[~2014-11-07 12:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 16:09 [Qemu-devel] [PATCH] vl: rework smp_parse Andrew Jones
2014-11-06 19:17 ` Eduardo Habkost
2014-11-07  9:22   ` Andrew Jones
2014-11-07 11:29     ` Andrew Jones
2014-11-06 22:11 ` Paolo Bonzini
2014-11-07  9:29   ` Andrew Jones
2014-11-07  9:40     ` Paolo Bonzini
2014-11-07  9:52       ` Andrew Jones
2014-11-07 11:21         ` Andrew Jones
2014-11-07 12:16           ` Eduardo Habkost
2014-11-07 12:23             ` Andrew Jones [this message]
2014-11-07 12:32               ` Eduardo Habkost
2014-11-07 16:03 ` Andrew Jones

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=20141107122312.GA10985@hawk.usersys.redhat.com \
    --to=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).