All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Babu Moger <babu.moger@amd.com>
Cc: ehabkost@redhat.com, mst@redhat.com, qemu-devel@nongnu.org,
	pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [PATCH v4 2/3] hw/i386: Update the EPYC topology to use socket/dies/core/thread model
Date: Wed, 19 Aug 2020 13:25:38 +0200	[thread overview]
Message-ID: <20200819132538.1173e444@redhat.com> (raw)
In-Reply-To: <159744117377.39197.9319853595178174798.stgit@naples-babu.amd.com>

On Fri, 14 Aug 2020 16:39:33 -0500
Babu Moger <babu.moger@amd.com> wrote:

> Update the EPYC topology to use socket/dies/core/thread model. The EPYC
> model does not use the smp dies to build the topology. Instead, it uses
> numa nodes to build the topology. Internally both are similar concept
> which divides the cores on L3 boundary. Combining both into one terminology
> makes it simple to program.
> 
> Add a new check to error out when smp dies are not provided when EPYC
> model is numa configured. Next task is to remove node_id, nr_nodes and
> nodes_per_pkg from EPYC topology which will be done in next patch.
> 
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---
>  hw/i386/x86.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/i386/x86.c b/hw/i386/x86.c
> index 67bee1bcb8..e90c42d2fc 100644
> --- a/hw/i386/x86.c
> +++ b/hw/i386/x86.c
> @@ -138,6 +138,14 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
>  
>      /* Check for apicid encoding */
>      if (cpu_x86_use_epyc_apic_id_encoding(ms->cpu_type)) {
> +        if ((ms->numa_state->num_nodes > 0) &&

> +            ms->numa_state->num_nodes != (ms->smp.sockets * x86ms->smp_dies)) {
this case is gated by (ms->numa_state->num_nodes > 0) so it won't work in case
 -smp dies=>1 but there is no -numa options at all

we need to error out and ask to provide numa nodes corresponding to
   (ms->numa_state->num_nodes == 0) && (ms->smp.sockets * x86ms->smp_dies)

or better alternative would be to enable autonuma when EPYC cpu is enabled,
that will insure that this patch will work even if user hasn't specified -numa option,
since it will create a single numa node automatically.

The later will take care of (-smp 1,dies=1) case, which is broken due to
lack of explicit -numa we end up with CPU_UNSET_NUMA_NODE_ID in CPUID_Fn8000001E_ECX.

> +            error_setg(&error_fatal, "Numa configuration here requires smp "
> +                       "'dies' parameter. Configure the cpu topology properly "
> +                       "with max_cpus = sockets * dies * cores * threads. Dies"
> +                       " is equivalent to number of numa nodes in a socket.");
> +            return;
> +        }
>          x86_set_epyc_topo_handlers(ms);
>      }
>  
> 



  reply	other threads:[~2020-08-19 11:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 21:39 [PATCH v4 0/3] Modify AMD topology to use socket/dies/core/thread model Babu Moger
2020-08-14 21:39 ` [PATCH v4 1/3] i386: Simplify CPUID_8000_001E for AMD Babu Moger
2020-08-14 21:39 ` [PATCH v4 2/3] hw/i386: Update the EPYC topology to use socket/dies/core/thread model Babu Moger
2020-08-19 11:25   ` Igor Mammedov [this message]
2020-08-19 22:10     ` Babu Moger
2020-08-14 21:39 ` [PATCH v4 3/3] hw/i386: Remove node_id, nr_nodes and nodes_per_pkg from topology Babu Moger
2020-08-19 12:18   ` Igor Mammedov
2020-08-19 22:42     ` Babu Moger
2020-08-20 12:57       ` Igor Mammedov
2020-08-20 15:24         ` Babu Moger
2020-08-15 17:12 ` [PATCH v4 0/3] Modify AMD topology to use socket/dies/core/thread model no-reply

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=20200819132538.1173e444@redhat.com \
    --to=imammedo@redhat.com \
    --cc=babu.moger@amd.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.