qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
	qemu-ppc@nongnu.org, clg@kaod.org,
	Nicholas Piggin <npiggin@gmail.com>,
	david@gibson.dropbear.id.au
Subject: Re: [PATCH] spapr_numa.c: fix FORM1 distance-less nodes
Date: Wed, 10 Nov 2021 09:41:06 -0300	[thread overview]
Message-ID: <d0f4e167-a0fa-c62f-6a19-201e0a40a116@gmail.com> (raw)
In-Reply-To: <490a7d19-9e16-b77e-2114-032d7c5091d6@linaro.org>



On 11/10/21 06:58, Richard Henderson wrote:
> On 11/9/21 7:35 PM, Daniel Henrique Barboza wrote:
>> Commit 71e6fae3a99 fixed an issue with FORM2 affinity guests with NUMA
>> nodes in which the distance info is absent in
>> machine_state->numa_state->nodes. This happens when QEMU adds a default
>> NUMA node and when the user adds NUMA nodes without specifying the
>> distances.
>>
>> During the discussions of the forementioned patch [1] it was found that
>> FORM1 guests were behaving in a strange way in the same scenario, with
>> the kernel seeing the distances between the nodes as '160', as we can
>> see in this example with 4 NUMA nodes without distance information:
>>
>> $ numactl -H
>> available: 4 nodes (0-3)
>> (...)
>> node distances:
>> node   0   1   2   3
>>    0:  10  160  160  160
>>    1:  160  10  160  160
>>    2:  160  160  10  160
>>    3:  160  160  160  10
>>
>> Turns out that we have the same problem with FORM1 guests - we are
>> calculating associativity domain using zeroed values. And as it also
>> turns out, the solution from 71e6fae3a99 applies for FORM1 as well.
>>
>> This patch creates a wrapper called 'get_numa_distance' that contains
>> the logic used in FORM2 to define node distances when this information
>> is absent. This helper is then used in all places where we need to read
>> distance information from machine_state->numa_state->nodes. That way
>> we'll guarantee that the NUMA node distance is always being curated
>> before being used.
>>
>> After this patch, the FORM1 guest mentioned above will have the
>> following topology:
>>
>> $ numactl -H
>> available: 4 nodes (0-3)
>> (...)
>> node distances:
>> node   0   1   2   3
>>    0:  10  20  20  20
>>    1:  20  10  20  20
>>    2:  20  20  10  20
>>    3:  20  20  20  10
>>
>> This is compatible with what FORM2 guests and other archs do in this
>> case.
>>
>> [1] https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg01960.html
>>
>> CC: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>> CC: Nicholas Piggin <npiggin@gmail.com>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>> ---
>>   hw/ppc/spapr_numa.c | 62 ++++++++++++++++++++++-----------------------
>>   1 file changed, 31 insertions(+), 31 deletions(-)
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Thanks!

I forgot to add the "Fixes:" tag at the end of the commit msg though, so I
ended up sending a v2 adding it. Your r-b is kept in the v2.


Daniel


> 
> 
> r~


      reply	other threads:[~2021-11-10 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 18:35 [PATCH] spapr_numa.c: fix FORM1 distance-less nodes Daniel Henrique Barboza
2021-11-10  9:58 ` Richard Henderson
2021-11-10 12:41   ` Daniel Henrique Barboza [this message]

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=d0f4e167-a0fa-c62f-6a19-201e0a40a116@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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).