From: Pierre Morel <pmorel@linux.ibm.com>
To: Nina Schoetterl-Glausch <nsg@linux.ibm.com>, qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com,
pasic@linux.ibm.com, richard.henderson@linaro.org,
david@redhat.com, thuth@redhat.com, cohuck@redhat.com,
mst@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org,
ehabkost@redhat.com, marcel.apfelbaum@gmail.com,
eblake@redhat.com, armbru@redhat.com, seiden@linux.ibm.com,
nrb@linux.ibm.com, frankja@linux.ibm.com, berrange@redhat.com,
clg@kaod.org
Subject: Re: [PATCH v18 01/17] s390x/cpu topology: add s390 specifics to CPU topology
Date: Tue, 28 Mar 2023 13:29:08 +0200 [thread overview]
Message-ID: <0bda770f-c073-3ed0-be26-3a77c8e40b8a@linux.ibm.com> (raw)
In-Reply-To: <1facc09195ef25a5f7ecf9c3bcc016fa1b313628.camel@linux.ibm.com>
On 3/27/23 23:34, Nina Schoetterl-Glausch wrote:
> On Wed, 2023-03-15 at 15:34 +0100, Pierre Morel wrote:
>> S390 adds two new SMP levels, drawers and books to the CPU
>> topology.
>> The S390 CPU have specific topology features like dedication
>> and entitlement to give to the guest indications on the host
>> vCPUs scheduling and help the guest take the best decisions
>> on the scheduling of threads on the vCPUs.
>>
>> Let us provide the SMP properties with books and drawers levels
>> and S390 CPU with dedication and entitlement,
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>> ---
>> qapi/machine-common.json | 22 +++++++++++++++
>> qapi/machine-target.json | 12 +++++++++
>> qapi/machine.json | 17 +++++++++---
>> include/hw/boards.h | 10 ++++++-
>> include/hw/s390x/cpu-topology.h | 15 +++++++++++
>> target/s390x/cpu.h | 6 +++++
>> hw/core/machine-smp.c | 48 ++++++++++++++++++++++++++++-----
>> hw/core/machine.c | 4 +++
>> hw/s390x/s390-virtio-ccw.c | 2 ++
>> softmmu/vl.c | 6 +++++
>> target/s390x/cpu.c | 7 +++++
>> qapi/meson.build | 1 +
>> qemu-options.hx | 7 +++--
>> 13 files changed, 144 insertions(+), 13 deletions(-)
>> create mode 100644 qapi/machine-common.json
>> create mode 100644 include/hw/s390x/cpu-topology.h
>>
> [...]
>> diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
>> index c3dab007da..b8233df5a9 100644
>> --- a/hw/core/machine-smp.c
>> +++ b/hw/core/machine-smp.c
>> @@ -31,6 +31,14 @@ static char *cpu_hierarchy_to_string(MachineState *ms)
>> MachineClass *mc = MACHINE_GET_CLASS(ms);
>> GString *s = g_string_new(NULL);
>>
>> + if (mc->smp_props.drawers_supported) {
>> + g_string_append_printf(s, " * drawers (%u)", ms->smp.drawers);
>> + }
>> +
>> + if (mc->smp_props.books_supported) {
>> + g_string_append_printf(s, " * books (%u)", ms->smp.books);
>> + }
>> +
>> g_string_append_printf(s, "sockets (%u)", ms->smp.sockets);
> The output of this doesn't look great.
> How about:
>
> static char *cpu_hierarchy_to_string(MachineState *ms)
> {
> MachineClass *mc = MACHINE_GET_CLASS(ms);
> GString *s = g_string_new(NULL);
> const char *multiply = " * ", *prefix = "";
>
> if (mc->smp_props.drawers_supported) {
> g_string_append_printf(s, "drawers (%u)", ms->smp.drawers);
> prefix = multiply;
> }
>
> if (mc->smp_props.books_supported) {
> g_string_append_printf(s, "%sbooks (%u)", prefix, ms->smp.books);
> prefix = multiply;
> }
>
> g_string_append_printf(s, "%ssockets (%u)", prefix, ms->smp.sockets);
>
> if (mc->smp_props.dies_supported) {
> g_string_append_printf(s, " * dies (%u)", ms->smp.dies);
> }
>
> if (mc->smp_props.clusters_supported) {
> g_string_append_printf(s, " * clusters (%u)", ms->smp.clusters);
> }
>
> g_string_append_printf(s, " * cores (%u)", ms->smp.cores);
> g_string_append_printf(s, " * threads (%u)", ms->smp.threads);
>
> return g_string_free(s, false);
> }
>
>
> [...]
Yes, looks better, thanks
regards,
Pierre
next prev parent reply other threads:[~2023-03-28 11:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 14:34 [PATCH v18 00/17] s390x: CPU Topology Pierre Morel
2023-03-15 14:34 ` [PATCH v18 01/17] s390x/cpu topology: add s390 specifics to CPU topology Pierre Morel
2023-03-27 21:34 ` Nina Schoetterl-Glausch
2023-03-28 11:29 ` Pierre Morel [this message]
2023-03-15 14:34 ` [PATCH v18 02/17] s390x/cpu topology: add topology entries on CPU hotplug Pierre Morel
2023-03-15 14:34 ` [PATCH v18 03/17] target/s390x/cpu topology: handle STSI(15) and build the SYSIB Pierre Morel
2023-03-15 14:34 ` [PATCH v18 04/17] s390x/sclp: reporting the maximum nested topology entries Pierre Morel
2023-03-15 14:34 ` [PATCH v18 05/17] s390x/cpu topology: resetting the Topology-Change-Report Pierre Morel
2023-03-15 14:34 ` [PATCH v18 06/17] s390x/cpu topology: interception of PTF instruction Pierre Morel
2023-03-15 14:34 ` [PATCH v18 07/17] target/s390x/cpu topology: activate CPU topology Pierre Morel
2023-03-15 14:34 ` [PATCH v18 08/17] qapi/s390x/cpu topology: set-cpu-topology qmp command Pierre Morel
2023-03-15 14:34 ` [PATCH v18 09/17] machine: adding s390 topology to query-cpu-fast Pierre Morel
2023-03-15 14:34 ` [PATCH v18 10/17] machine: adding s390 topology to info hotpluggable-cpus Pierre Morel
2023-03-15 14:34 ` [PATCH v18 11/17] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event Pierre Morel
2023-03-15 14:34 ` [PATCH v18 12/17] docs/s390x/cpu topology: document s390x cpu topology Pierre Morel
2023-03-15 14:34 ` [PATCH v18 13/17] tests/avocado: s390x cpu topology core Pierre Morel
2023-03-15 14:34 ` [PATCH v18 14/17] tests/avocado: s390x cpu topology polarisation Pierre Morel
2023-03-15 14:35 ` [PATCH v18 15/17] tests/avocado: s390x cpu topology entitlement tests Pierre Morel
2023-03-15 14:35 ` [PATCH v18 16/17] tests/avocado: s390x cpu topology test dedicated CPU Pierre Morel
2023-03-15 14:35 ` [PATCH v18 17/17] tests/avocado: s390x cpu topology test socket full Pierre Morel
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=0bda770f-c073-3ed0-be26-3a77c8e40b8a@linux.ibm.com \
--to=pmorel@linux.ibm.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=clg@kaod.org \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=seiden@linux.ibm.com \
--cc=thuth@redhat.com \
/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).