qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] docs/system/cpu-hotplug: Update example's socket-id/core-id
Date: Tue, 10 Sep 2024 10:38:42 +0100	[thread overview]
Message-ID: <CAFEAcA_Rjiy1so28OVPpL=+++XuU+gSXhn-v_WHMcpc_wa_xMw@mail.gmail.com> (raw)
In-Reply-To: <20240910110344.10e4805e@imammedo.users.ipa.redhat.com>

On Tue, 10 Sept 2024 at 10:03, Igor Mammedov <imammedo@redhat.com> wrote:
>
> On Mon, 19 Aug 2024 15:43:03 +0100
> Peter Maydell <peter.maydell@linaro.org> wrote:
>
> > At some point the way we allocate socket-id and core-id to CPUs
> > by default changed; update the example of how to do CPU hotplug
> > and unplug so the example commands work again. The differences
> > in the sample input and output are:
> >  * the second CPU is now socket-id=0 core-id=1,
> >    not socket-id=1 core-id=0
> >  * the order of fields from the qmp_shell is different (it seems
> >    to now always be in alphabetical order)
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> > I noticed this while I was playing around with vcpu hotplug trying to
> > demonstrate a memory leak I want to fix...
> >
> >  docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++-------------------
> >  1 file changed, 26 insertions(+), 28 deletions(-)
> >
> > diff --git a/docs/system/cpu-hotplug.rst b/docs/system/cpu-hotplug.rst
> > index 015ce2b6ec3..443ff226b90 100644
> > --- a/docs/system/cpu-hotplug.rst
> > +++ b/docs/system/cpu-hotplug.rst
> > @@ -33,23 +33,23 @@ vCPU hotplug
> >        {
> >            "return": [
> >                {
> > -                  "type": "IvyBridge-IBRS-x86_64-cpu",
> > -                  "vcpus-count": 1,
> >                    "props": {
> > -                      "socket-id": 1,
> > -                      "core-id": 0,
> > +                      "core-id": 1,
> > +                      "socket-id": 0,
> >                        "thread-id": 0
> > -                  }
> > +                  },
> > +                  "type": "IvyBridge-IBRS-x86_64-cpu",
> > +                  "vcpus-count": 1
> >                },
> >                {
> > +                  "props": {
> > +                      "core-id": 0,
> > +                      "socket-id": 0,
> > +                      "thread-id": 0
> > +                  },
> >                    "qom-path": "/machine/unattached/device[0]",
> >                    "type": "IvyBridge-IBRS-x86_64-cpu",
> > -                  "vcpus-count": 1,
> > -                  "props": {
> > -                      "socket-id": 0,
> > -                      "core-id": 0,
> > -                      "thread-id": 0
> > -                  }
> > +                  "vcpus-count": 1
> >                }
> >            ]
> >        }
> > @@ -58,18 +58,18 @@ vCPU hotplug
> >  (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
> >      that are present (containing a "qom-path" member) or which may be
> >      hot-plugged (no "qom-path" member).  From its output in step (3), we
> > -    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
> > -    while hot-plugging a CPU into socket 1 requires passing the listed
> > +    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0,
> > +    while hot-plugging a CPU into socket 0 core 1 requires passing the listed
> >      properties to QMP ``device_add``::
> >
>
> >        (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
>
> >        {
> >            "execute": "device_add",
> >            "arguments": {
> > -              "socket-id": 1,
> > +              "core-id": 1,
> >                "driver": "IvyBridge-IBRS-x86_64-cpu",
> >                "id": "cpu-2",
> > -              "core-id": 0,
> > +              "socket-id": 0,
> >                "thread-id": 0
>
> after above changes device_add doesn't match comment nor 'execute' output

Oops, yes. The device_add line should be changed too
("socket-id=0 core-id=1 thread-id=0").

>
> >            }
> >        }
> > @@ -83,34 +83,32 @@ vCPU hotplug
> >
> >        (QEMU) query-cpus-fast
> >        {
> > -          "execute": "query-cpus-fast",
> >            "arguments": {}
> > +          "execute": "query-cpus-fast",
> >        }
> >        {
> >            "return": [
> >                {
> > -                  "qom-path": "/machine/unattached/device[0]",
> > -                  "target": "x86_64",
> > -                  "thread-id": 11534,
> >                    "cpu-index": 0,
> >                    "props": {
> > -                      "socket-id": 0,
> >                        "core-id": 0,
> > +                      "socket-id": 0,
> >                        "thread-id": 0
> >                    },
> > -                  "arch": "x86"
> > +                  "qom-path": "/machine/unattached/device[0]",
> > +                  "target": "x86_64",
> > +                  "thread-id": 28957
> >                },
> >                {
> > -                  "qom-path": "/machine/peripheral/cpu-2",
> > -                  "target": "x86_64",
> > -                  "thread-id": 12106,
> >                    "cpu-index": 1,
> >                    "props": {
> > -                      "socket-id": 1,
> > -                      "core-id": 0,
> > +                      "core-id": 1,
> > +                      "socket-id": 0,
> >                        "thread-id": 0
> >                    },
> > -                  "arch": "x86"
> > +                  "qom-path": "/machine/peripheral/cpu-2",
> > +                  "target": "x86_64",
> > +                  "thread-id": 29095
> >                }
>
> beside reordering, which seems fine, this hunk also introduces target change
> perhaps a separate patch for that?

What target change? It all says "target": "x86_64" both before
and after.

thanks
-- PMM


  reply	other threads:[~2024-09-10  9:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 14:43 [PATCH] docs/system/cpu-hotplug: Update example's socket-id/core-id Peter Maydell
2024-09-06 15:13 ` Peter Maydell
2024-09-10  9:03 ` Igor Mammedov
2024-09-10  9:38   ` Peter Maydell [this message]
2024-09-19 12:34     ` Peter Maydell
2024-09-20 10:45       ` Igor Mammedov
2024-10-03 14:54         ` Peter Maydell
2024-10-07 12:04           ` Igor Mammedov

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='CAFEAcA_Rjiy1so28OVPpL=+++XuU+gSXhn-v_WHMcpc_wa_xMw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@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 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).