On Fri, 29 May 2020 15:33:48 +0200
Michal Privoznik <mpriv...@redhat.com> wrote:

> The initiator attribute of a NUMA node is documented as the 'NUMA
> node that has best performance to given NUMA node'. If a NUMA
> node has at least one CPU there can hardly be a different node
> with better performace and thus all NUMA nodes which have a CPU
> are initiators to themselves. Reflect this fact when initializing
> the attribute.

It is not true in case of the node is memory-less

> Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
> ---
>  hw/core/numa.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index 338453461c..1c9bc761cc 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -136,11 +136,15 @@ static void parse_numa_node(MachineState *ms, 
> NumaNodeOptions *node,
>          numa_info[nodenr].node_memdev = MEMORY_BACKEND(o);
>      }
>  
> -    /*
> -     * If not set the initiator, set it to MAX_NODES. And if
> -     * HMAT is enabled and this node has no cpus, QEMU will raise error.
> -     */
> -    numa_info[nodenr].initiator = MAX_NODES;
> +    /* Initialize initiator to either the current NUMA node (if
> +     * it has at least one CPU), or to MAX_NODES. If HMAT is
> +     * enabled an error will be raised later in
> +     * numa_validate_initiator(). */
> +    if (numa_info[nodenr].has_cpu)
> +        numa_info[nodenr].initiator = nodenr;
> +    else
> +        numa_info[nodenr].initiator = MAX_NODES;
> +
>      if (node->has_initiator) {
>          if (!ms->numa_state->hmat_enabled) {
>              error_setg(errp, "ACPI Heterogeneous Memory Attribute Table "


Reply via email to