qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Pierre Morel" <pmorel@linux.ibm.com>
Subject: Re: [PATCH v25 02/21] CPU topology: extend with s390 specifics
Date: Fri, 13 Oct 2023 14:58:41 +0200	[thread overview]
Message-ID: <fc5f73d3084259a23af3c35cbc54fb6b6780fb7b.camel@linux.ibm.com> (raw)
In-Reply-To: <87cyxkxfwz.fsf@pond.sub.org>

On Thu, 2023-10-12 at 13:02 +0200, Markus Armbruster wrote:
> Nina Schoetterl-Glausch <nsg@linux.ibm.com> writes:
> 
> > From: Pierre Morel <pmorel@linux.ibm.com>
> > 
> > S390 adds two new SMP levels, drawers and books to the CPU
> > topology.
> > S390 CPUs have specific topology features like dedication and
> > entitlement. These indicate to the guest information on host
> > vCPU scheduling and help the guest make better scheduling decisions.
> > 
> > Let us provide the SMP properties with books and drawers levels
> > and S390 CPU with dedication and entitlement,
> 
> This is vague.  Peeking at the patch, I can see it adds properties
> "socket-id", "book-id", "drawer-id", "dedicated", and "entitlement" to
> "s390x-cpu" objects.  Suggest to spell that out here.
> 
> > Add machine-common.json so we can later include it in
> > machine-target.json also.
> > 
> > Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> > Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> > Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> > ---
> >  MAINTAINERS                         |  1 +
> >  qapi/machine-common.json            | 21 +++++++++++++
> >  qapi/machine.json                   | 17 +++++++++-
> >  qapi/qapi-schema.json               |  1 +
> >  include/hw/boards.h                 | 10 +++++-
> >  include/hw/qdev-properties-system.h |  4 +++
> >  target/s390x/cpu.h                  |  6 ++++
> >  hw/core/machine-smp.c               | 48 ++++++++++++++++++++++++-----
> >  hw/core/machine.c                   |  4 +++
> >  hw/core/qdev-properties-system.c    | 13 ++++++++
> >  hw/s390x/s390-virtio-ccw.c          |  4 +++
> >  softmmu/vl.c                        |  6 ++++
> >  target/s390x/cpu.c                  |  7 +++++
> >  qapi/meson.build                    |  1 +
> >  qemu-options.hx                     |  7 +++--
> >  15 files changed, 139 insertions(+), 11 deletions(-)
> >  create mode 100644 qapi/machine-common.json
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 81625f036b..3f6888aa86 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -1775,6 +1775,7 @@ F: hw/core/null-machine.c
> >  F: hw/core/numa.c
> >  F: hw/cpu/cluster.c
> >  F: qapi/machine.json
> > +F: qapi/machine-common.json
> >  F: qapi/machine-target.json
> >  F: include/hw/boards.h
> >  F: include/hw/core/cpu.h
> > diff --git a/qapi/machine-common.json b/qapi/machine-common.json
> > new file mode 100644
> > index 0000000000..fa6bd71d12

[...] 

> >  ##
> >  # @SysEmuTarget:
> > @@ -904,7 +905,13 @@
> >  #
> >  # @node-id: NUMA node ID the CPU belongs to
> >  #
> > -# @socket-id: socket number within node/board the CPU belongs to
> > +# @drawer-id: drawer number within node/board the CPU belongs to
> > +#     (since 8.2)
> > +#
> > +# @book-id: book number within drawer/node/board the CPU belongs to
> > +#     (since 8.2)
> > +#
> > +# @socket-id: socket number within book/node/board the CPU belongs to
> >  #
> >  # @die-id: die number within socket the CPU belongs to (since 4.1)
> >  #
>    # @cluster-id: cluster number within die the CPU belongs to (since
>    #     7.1)
>    #
>    # @core-id: core number within cluster the CPU belongs to
>    #
>    # @thread-id: thread number within core the CPU belongs to
> 
> So...
> 
> * A thread can only be within a core
> 
> * A core can only be within a cluster
> 
> * A cluster can only be within a die
> 
> * A die can only be within a socket
> 
> * A socket can be within a book, node, or board
> 
> * A book can be within a drawer, node, or board
> 
> * A drawer can be within a node, or board
> 
> * A node is a NUMA node
> 
> * A board is what exactly?  can we have more than one?  is node always
>   within a/the board?

Yeah, the description is confusing.
> 
> Asked differently: what are the possible hierarchies of things?

The way I understand things is:
* Different architectures have different hierarchies, say
  1. (thread, core, cluster, die, socket)
  2. (thread, core, socket, book, drawer)

We define a qemu artificial ordered super set
(thread, core, cluster, die, socket, book, drawer)
where architectures can choose a subset of, specifying that they
support a certain level or not.

Now if for example x86 wanted to support a book level between
thread and core, we'd need to change a bunch of code and make
things more complicated.

The NUMA node-id maps a hierarchy tuple to a node, I don't think
it's part of hierarchy itself.

Now the question is how to document this.
On s390x there is no cluster, so what does

@core-id: core number within cluster the CPU belongs to

mean?

We could say, that within the qemu super set there is a virtual
cluster of which there is one per die (and one die per socket).

Or we rewrite the documentation to say

@x-id: x number within the upper hierarchy container

to account for the fact that the upper container is different
on different architectures.


> 
> > @@ -923,6 +930,8 @@
> >  { 'struct': 'CpuInstanceProperties',
> >    # Keep these in sync with the properties device_add accepts
> >    'data': { '*node-id': 'int',
> > +            '*drawer-id': 'int',
> > +            '*book-id': 'int',
> >              '*socket-id': 'int',
> >              '*die-id': 'int',
> >              '*cluster-id': 'int',
> > @@ -1481,6 +1490,10 @@
> >  #
> >  # @cpus: number of virtual CPUs in the virtual machine
> >  #
> > +# @drawers: number of drawers in the CPU topology (since 8.2)
> > +#
> > +# @books: number of books in the CPU topology (since 8.2)
> > +#
> >  # @sockets: number of sockets in the CPU topology
> 
> Total numer of sockets?  Or number of sockets per whatever thing
> contains sockets?

The latter. I'll change this
> 
> Same question for @books, @drawers, and @cpus.

Same for the first two, total for @cpus.
> 
> The documentation is less than clear before your patch; your patch
> merely makes me look at it.  We may decide that addressing the lack of
> clarity is not your patch's job, and leave it for later.

Yeah, same problem here around different architectures using different sub sets.
> 
> >  #
> >  # @dies: number of dies per socket in the CPU topology
> > @@ -1499,6 +1512,8 @@
> >  ##
> >  { 'struct': 'SMPConfiguration', 'data': {
> >       '*cpus': 'int',
> > +     '*drawers': 'int',
> > +     '*books': 'int',
> >       '*sockets': 'int',
> >       '*dies': 'int',
> >       '*clusters': 'int',

[...]


  reply	other threads:[~2023-10-13 12:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 16:01 [PATCH v25 00/21] s390x: CPU Topology Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 01/21] qapi: machine.json: change docs regarding CpuInstanceProperties Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 02/21] CPU topology: extend with s390 specifics Nina Schoetterl-Glausch
2023-10-12 11:02   ` Markus Armbruster
2023-10-13 12:58     ` Nina Schoetterl-Glausch [this message]
2023-10-13 13:39       ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 03/21] s390x/cpu topology: add topology entries on CPU hotplug Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 04/21] target/s390x/cpu topology: handle STSI(15) and build the SYSIB Nina Schoetterl-Glausch
2023-10-06  8:05   ` Thomas Huth
2023-10-12 11:07   ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 05/21] s390x/sclp: reporting the maximum nested topology entries Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 06/21] s390x/cpu topology: resetting the Topology-Change-Report Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 07/21] s390x/cpu topology: interception of PTF instruction Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 08/21] target/s390x/cpu topology: activate CPU topology Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 09/21] qapi/s390x/cpu topology: set-cpu-topology qmp command Nina Schoetterl-Glausch
2023-10-06  8:20   ` Thomas Huth
2023-10-12 11:34   ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 10/21] machine: adding s390 topology to query-cpu-fast Nina Schoetterl-Glausch
2023-10-12 11:37   ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 11/21] machine: adding s390 topology to info hotpluggable-cpus Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 12/21] qapi/s390x/cpu topology: CPU_POLARIZATION_CHANGE qapi event Nina Schoetterl-Glausch
2023-10-12 11:40   ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 13/21] qapi/s390x/cpu topology: add query-s390x-cpu-polarization command Nina Schoetterl-Glausch
2023-10-12 11:41   ` Markus Armbruster
2023-10-05 16:01 ` [PATCH v25 14/21] docs/s390x/cpu topology: document s390x cpu topology Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 15/21] tests/avocado: s390x cpu topology core Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 16/21] tests/avocado: s390x cpu topology polarization Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 17/21] tests/avocado: s390x cpu topology entitlement tests Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 18/21] tests/avocado: s390x cpu topology test dedicated CPU Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 19/21] tests/avocado: s390x cpu topology test socket full Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 20/21] tests/avocado: s390x cpu topology dedicated errors Nina Schoetterl-Glausch
2023-10-05 16:01 ` [PATCH v25 21/21] tests/avocado: s390x cpu topology bad move Nina Schoetterl-Glausch

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=fc5f73d3084259a23af3c35cbc54fb6b6780fb7b.camel@linux.ibm.com \
    --to=nsg@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=crosa@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=wangyanan55@huawei.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).