All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Day <ncmike@ncultra.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: Paul Mackerras <paulus@samba.org>,
	qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC PATCH v2] PPC: smp: autodetect numbers of threads per core
Date: Thu, 09 Jan 2014 16:00:58 -0500	[thread overview]
Message-ID: <87ppo0na45.fsf@pixel.localdomain> (raw)
In-Reply-To: <1389245648-10300-1-git-send-email-aik@ozlabs.ru>


Alexey Kardashevskiy <aik@ozlabs.ru> writes:

>          /* compute missing values, prefer sockets over cores over threads */
>          if (cpus == 0 || sockets == 0) {
>              sockets = sockets > 0 ? sockets : 1;
>              cores = cores > 0 ? cores : 1;
> -            threads = threads > 0 ? threads : 1;
> +            if (threads_max) {
> +                if (threads > 0) {
> +                    fprintf(stderr, "Use either threads or threads_max\n");
> +                    exit(1);

If you went ahead with the threads="max" string option you wouldn't need
to check here for mutual excusivity and the user wouldn't need to worry
about an extra command options.

> +                }
> +                threads = smp_threads > 0 ? smp_threads : 1;
> +            } else {
> +                threads = threads > 0 ? threads : 1;
> +            }
>              if (cpus == 0) {
>                  cpus = cores * threads * sockets;
>              }

-- 
Mike Day | "Endurance is a Virtue"

  reply	other threads:[~2014-01-09 21:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09  5:34 [Qemu-devel] [RFC PATCH v2] PPC: smp: autodetect numbers of threads per core Alexey Kardashevskiy
2014-01-09 21:00 ` Mike Day [this message]
2014-01-09 22:12   ` Alexey Kardashevskiy
2014-01-09 23:40     ` Alexander Graf
2014-01-10  1:39       ` Alexey Kardashevskiy
2014-01-10 13:03         ` Mike Day
2014-01-10 13:28           ` Alexander Graf
2014-01-10 13:42             ` Alexey Kardashevskiy
2014-01-10 14:00               ` Alexander Graf
2014-01-10 14:13                 ` Alexey Kardashevskiy
2014-01-10 14:20                   ` Alexander Graf
2014-01-10 14:21                   ` Mike Day
2014-01-10 14:25                     ` Alexander Graf
2014-01-10 14:29                       ` Mike Day
2014-01-10 14:35                       ` Alexey Kardashevskiy
2014-01-10 14:12             ` Mike Day
2014-01-09 22:50 ` Scott Wood

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=87ppo0na45.fsf@pixel.localdomain \
    --to=ncmike@ncultra.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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.