From: Igor Mammedov <imammedo@redhat.com>
To: Tao Xu <tao3.xu@intel.com>
Cc: ehabkost@redhat.com, jingqi.liu@intel.com, fan.du@intel.com,
qemu-devel@nongnu.org, jonathan.cameron@huawei.com,
dan.j.williams@intel.com
Subject: Re: [Qemu-devel] [PATCH v8 02/11] numa: move numa global variable nb_numa_nodes into MachineState
Date: Mon, 29 Jul 2019 15:09:57 +0200 [thread overview]
Message-ID: <20190729150957.157a7c03@redhat.com> (raw)
In-Reply-To: <20190729063127.2801-3-tao3.xu@intel.com>
On Mon, 29 Jul 2019 14:31:18 +0800
Tao Xu <tao3.xu@intel.com> wrote:
> Add struct NumaState in MachineState and move existing numa global
> nb_numa_nodes(renamed as "num_nodes") into NumaState. And add variable
> numa_support into MachineClass to decide which submachines support NUMA.
>
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Tao Xu <tao3.xu@intel.com>
> ---
>
> Changes in v8:
> - Add check if numa->numa_state is NULL in pxb_dev_realize_common
> - Use nb_nodes in spapr_populate_memory() (Igor)
> ---
[...]
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 821f0d4a49..1c7c12c415 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -331,7 +331,7 @@ static int spapr_fixup_cpu_dt(void *fdt, SpaprMachineState *spapr)
> return ret;
> }
>
> - if (nb_numa_nodes > 1) {
> + if (ms->numa_state->num_nodes > 1) {
> ret = spapr_fixup_cpu_numa_dt(fdt, offset, cpu);
> if (ret < 0) {
> return ret;
> @@ -351,9 +351,9 @@ static int spapr_fixup_cpu_dt(void *fdt, SpaprMachineState *spapr)
>
> static hwaddr spapr_node0_size(MachineState *machine)
> {
> - if (nb_numa_nodes) {
> + if (machine->numa_state->num_nodes) {
> int i;
> - for (i = 0; i < nb_numa_nodes; ++i) {
> + for (i = 0; i < machine->numa_state->num_nodes; ++i) {
> if (numa_info[i].node_mem) {
> return MIN(pow2floor(numa_info[i].node_mem),
> machine->ram_size);
> @@ -398,13 +398,14 @@ static int spapr_populate_memory(SpaprMachineState *spapr, void *fdt)
> {
> MachineState *machine = MACHINE(spapr);
> hwaddr mem_start, node_size;
> - int i, nb_nodes = nb_numa_nodes;
> + int i, nb_nodes = machine->numa_state->num_nodes;
> NodeInfo *nodes = numa_info;
> NodeInfo ramnode;
>
> /* No NUMA nodes, assume there is just one node with whole RAM */
> - if (!nb_numa_nodes) {
> + if (!nb_nodes) {
> nb_nodes = 1;
> + machine->numa_state->num_nodes = nb_nodes;
You've not addressed a v7 comment
On Tue, 23 Jul 2019 16:56:41 +0200
Igor Mammedov <imammedo@redhat.com> wrote:
> I don't like user fixing up generic machine data that came from CLI
> (or luck of such)
[...]
> I'd keep fixup local (i.e. using nb_nodes)
i.e. do not modify machine->numa_state->num_nodes and just use value local
like current code does.
> ramnode.node_mem = machine->ram_size;
> nodes = &ramnode;
> }
[...]
next prev parent reply other threads:[~2019-07-29 13:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 6:31 [Qemu-devel] [PATCH v8 00/11] Build ACPI Heterogeneous Memory Attribute Table (HMAT) Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 01/11] hw/arm: simplify arm_load_dtb Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 02/11] numa: move numa global variable nb_numa_nodes into MachineState Tao Xu
2019-07-29 13:09 ` Igor Mammedov [this message]
2019-07-30 0:53 ` Tao Xu
2019-07-30 9:11 ` Igor Mammedov
2019-07-30 21:12 ` Eduardo Habkost
2019-07-31 0:26 ` Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 03/11] numa: move numa global variable have_numa_distance " Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 04/11] numa: move numa global variable numa_info " Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 05/11] numa: Extend CLI to provide initiator information for numa nodes Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 06/11] hmat acpi: Build Memory Proximity Domain Attributes Structure(s) Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 07/11] hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s) Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 08/11] hmat acpi: Build Memory Side Cache " Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 09/11] numa: Extend the CLI to provide memory latency and bandwidth information Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 10/11] numa: Extend the CLI to provide memory side cache information Tao Xu
2019-07-29 6:31 ` [Qemu-devel] [PATCH v8 11/11] tests/bios-tables-test: add test cases for ACPI HMAT Tao Xu
2019-07-29 8:30 ` [Qemu-devel] [PATCH v8 00/11] Build ACPI Heterogeneous Memory Attribute Table (HMAT) 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=20190729150957.157a7c03@redhat.com \
--to=imammedo@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=ehabkost@redhat.com \
--cc=fan.du@intel.com \
--cc=jingqi.liu@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=tao3.xu@intel.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 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.