diff mbox series

[RESEND,01/18] machine: Fix comment of machine_parse_smp_config()

Message ID 20230213093625.158170-2-zhao1.liu@linux.intel.com
State New
Headers show
Series Support smp.clusters for x86 | expand

Commit Message

Zhao Liu Feb. 13, 2023, 9:36 a.m. UTC
From: Zhao Liu <zhao1.liu@intel.com>

Now smp supports dies and clusters, so add description about these 2
levels in the comment of machine_parse_smp_config().

Fixes: 864c3b5 (hw/core/machine: Introduce CPU cluster topology support)
Suggested-by: Robert Hoo <robert.hu@linux.intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/core/machine-smp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Zhao Liu Feb. 14, 2023, 2:22 p.m. UTC | #1
On Mon, Feb 13, 2023 at 09:31:53PM +0800, wangyanan (Y) wrote:
> Date: Mon, 13 Feb 2023 21:31:53 +0800
> From: "wangyanan (Y)" <wangyanan55@huawei.com>
> Subject: Re: [PATCH RESEND 01/18] machine: Fix comment of
>  machine_parse_smp_config()
> 
> 
> 在 2023/2/13 17:36, Zhao Liu 写道:
> > From: Zhao Liu <zhao1.liu@intel.com>
> > 
> > Now smp supports dies and clusters, so add description about these 2
> > levels in the comment of machine_parse_smp_config().
> > 
> > Fixes: 864c3b5 (hw/core/machine: Introduce CPU cluster topology support)
> > Suggested-by: Robert Hoo <robert.hu@linux.intel.com>
> > Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> > ---
> >   hw/core/machine-smp.c | 7 ++++---
> >   1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
> > index c3dab007dadc..3fd9e641efde 100644
> > --- a/hw/core/machine-smp.c
> > +++ b/hw/core/machine-smp.c
> > @@ -51,8 +51,8 @@ static char *cpu_hierarchy_to_string(MachineState *ms)
> >    * machine_parse_smp_config: Generic function used to parse the given
> >    *                           SMP configuration
> >    *
> > - * Any missing parameter in "cpus/maxcpus/sockets/cores/threads" will be
> > - * automatically computed based on the provided ones.
> > + * Any missing parameter in "cpus/maxcpus/sockets/dies/clusters/cores/threads"
> > + * will be automatically computed based on the provided ones.
> This is intential. Newly added topo params (apart from maxcpus/
> socket/cores/threads) wiil be assigned to 1 and not computed
> based the provided ones. There is no problem about this part.

Sorry, I see. Will fix.

> >    *
> >    * In the calculation of omitted sockets/cores/threads: we prefer sockets
> >    * over cores over threads before 6.2, while preferring cores over sockets
> > @@ -66,7 +66,8 @@ static char *cpu_hierarchy_to_string(MachineState *ms)
> >    *
> >    * For compatibility, apart from the parameters that will be computed, newly
> >    * introduced topology members which are likely to be target specific should
> > - * be directly set as 1 if they are omitted (e.g. dies for PC since 4.1).
> > + * be directly set as 1 if they are omitted (e.g. dies for PC since v4.1 and
> > + * clusters for arm since v7.0).
> >    */
> Given that we are going to support cluster for PC machine.
> Maybe simple "(i.e. dies for PC since 4.1)" here is good enough?

Makes sense. Now I understand this logic, and I will drop this commit.

Thanks,
Zhao

> 
> Thanks,
> Yanan
> >   void machine_parse_smp_config(MachineState *ms,
> >                                 const SMPConfiguration *config, Error **errp)
>
diff mbox series

Patch

diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
index c3dab007dadc..3fd9e641efde 100644
--- a/hw/core/machine-smp.c
+++ b/hw/core/machine-smp.c
@@ -51,8 +51,8 @@  static char *cpu_hierarchy_to_string(MachineState *ms)
  * machine_parse_smp_config: Generic function used to parse the given
  *                           SMP configuration
  *
- * Any missing parameter in "cpus/maxcpus/sockets/cores/threads" will be
- * automatically computed based on the provided ones.
+ * Any missing parameter in "cpus/maxcpus/sockets/dies/clusters/cores/threads"
+ * will be automatically computed based on the provided ones.
  *
  * In the calculation of omitted sockets/cores/threads: we prefer sockets
  * over cores over threads before 6.2, while preferring cores over sockets
@@ -66,7 +66,8 @@  static char *cpu_hierarchy_to_string(MachineState *ms)
  *
  * For compatibility, apart from the parameters that will be computed, newly
  * introduced topology members which are likely to be target specific should
- * be directly set as 1 if they are omitted (e.g. dies for PC since 4.1).
+ * be directly set as 1 if they are omitted (e.g. dies for PC since v4.1 and
+ * clusters for arm since v7.0).
  */
 void machine_parse_smp_config(MachineState *ms,
                               const SMPConfiguration *config, Error **errp)