All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, clg@kaod.org,
	bharata@linux.vnet.ibm.com, benh@kernel.crashing.org
Subject: Re: [Qemu-devel] [PATCH] ppc/pnv: fix cores per chip for multiple cpus
Date: Fri, 15 Sep 2017 16:48:30 +1000	[thread overview]
Message-ID: <20170915064830.GI5250@umbus.fritz.box> (raw)
In-Reply-To: <8760clsw17.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me>

[-- Attachment #1: Type: text/plain, Size: 2253 bytes --]

On Thu, Sep 14, 2017 at 10:42:52AM +0530, Nikunj A Dadhania wrote:
> David Gibson <david@gibson.dropbear.id.au> writes:
> 
> > On Mon, Sep 11, 2017 at 10:40:10AM +0530, Nikunj A Dadhania wrote:
> >> David Gibson <david@gibson.dropbear.id.au> writes:
> >> 
> >> > On Wed, Sep 06, 2017 at 01:57:48PM +0530, Nikunj A Dadhania wrote:
> >> >> When the user does not provide the cpu topology, e.g. "-smp 4", machine fails to
> >> >> initialize 4 cpus. Compute the chip per cores depending on the number of chips
> >> >> and smt threads.
> >> >> 
> >> >> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> >> >
> >> > I don't understand why simply treating smp_cores as cores per chip is wrong.
> >> 
> >> We do not have SMT support and when "-smp 4" is passed, smp_cores is
> >> always set to 1. So only once core with one thread finally show up in
> >> the guest. Moreover, I see spapr too doing similar thing in
> >> spapr_init_cpus() with boot_cores_nr.
> >
> > I'm ok with adding an error if smp_threads > 1, since that won't
> > work.  Breaking the identity that smp_cores is the number of cores per
> > socket (which should correspond to one chip) is not ok, though.
> >
> > I think you're misinterpreting the boot_cores_nr stuff - that's just
> > about translating the number of initially online vcpus into a number
> > of initially online cores.
> 
> I thought, I am doing the same here for PowerNV, number of online cores
> is equal to initial online vcpus / threads per core
> 
>    int boot_cores_nr = smp_cpus / smp_threads;
> 
> Only difference that I see in PowerNV is that we have multiple chips
> (max 2, at the moment)
> 
>         cores_per_chip = smp_cpus / (smp_threads * pnv->num_chips);

This doesn't make sense to me.  Cores per chip should *always* equal
smp_cores, you shouldn't need another calculation for it.

> And in case user has provided sane smp_cores, we use it.

If smp_cores isn't sane, you should simply reject it, not try to fix
it.  That's just asking for confusion.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-09-15  8:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06  8:27 [Qemu-devel] [PATCH] ppc/pnv: fix cores per chip for multiple cpus Nikunj A Dadhania
2017-09-08  6:38 ` Cédric Le Goater
2017-09-09  7:02 ` David Gibson
2017-09-11  5:10   ` Nikunj A Dadhania
2017-09-13  7:35     ` David Gibson
2017-09-14  5:12       ` Nikunj A Dadhania
2017-09-15  6:48         ` David Gibson [this message]
2017-09-15  8:23           ` Nikunj A Dadhania
2017-09-15  8:51             ` David Gibson
2017-09-15  9:09               ` Nikunj A Dadhania
2017-09-19  8:24                 ` David Gibson
2017-09-20  4:20                   ` Nikunj A Dadhania
2017-09-20  4:55                     ` David Gibson
2017-09-20  5:13                       ` Nikunj A Dadhania
2017-09-20  6:17                         ` David Gibson
2017-09-20  6:40                           ` Nikunj A Dadhania
2017-09-20  6:50                             ` Nikunj A Dadhania
2017-09-20  6:57                             ` David Gibson
2017-09-20  7:18                               ` Nikunj A Dadhania
2017-09-20  8:12                                 ` Cédric Le Goater
2017-09-20 11:53                                 ` David Gibson
2017-09-21  3:54                                   ` Nikunj A Dadhania
2017-09-21  5:31                                     ` David Gibson
2017-09-22  6:00                                       ` Nikunj A Dadhania
2017-09-22  6:07                                         ` Cédric Le Goater
2017-09-22 10:12                                           ` David Gibson
2017-09-22 10:46                                             ` Cédric Le Goater
2017-09-22 11:20                                               ` David Gibson
2017-09-22 11:37                                                 ` Cédric Le Goater
2017-09-22 11:49                                                   ` David Gibson
2017-09-22 11:46                                                 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-09-22 10:56                                         ` [Qemu-devel] " Cédric Le Goater
2017-09-22 11:06                                           ` Nikunj A Dadhania
2017-09-22 11:36                                           ` David Gibson
2017-09-21  6:04                                     ` Cédric Le Goater
2017-09-21  7:42                                       ` Igor Mammedov
2017-09-22 10:09                                         ` David Gibson
2017-09-22 10:08                                       ` David Gibson
2017-09-22 10:52                                         ` Cédric Le Goater

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=20170915064830.GI5250@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=clg@kaod.org \
    --cc=nikunj@linux.vnet.ibm.com \
    --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.