OSDN Git Service

qtest/numa-test: Correct CPU and NUMA association in aarch64_numa_cpu()
authorGavin Shan <gshan@redhat.com>
Tue, 3 May 2022 14:03:02 +0000 (22:03 +0800)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 9 May 2022 10:47:55 +0000 (11:47 +0100)
commite280ecb39bc1629f74ea5479d464fd1608dc8f76
tree7099169ecd08cdda8a6079cb9e5340b15c4b2f2b
parentc9ec4cb5e4936f980889e717524e73896b0200ed
qtest/numa-test: Correct CPU and NUMA association in aarch64_numa_cpu()

In aarch64_numa_cpu(), the CPU and NUMA association is something
like below. Two threads in the same core/cluster/socket are
associated with two individual NUMA nodes, which is unreal as
Igor Mammedov mentioned. We don't expect the association to break
NUMA-to-socket boundary, which matches with the real world.

    NUMA-node  socket  cluster   core   thread
    ------------------------------------------
        0       0        0        0      0
        1       0        0        0      1

This corrects the topology for CPUs and their association with
NUMA nodes. After this patch is applied, the CPU and NUMA
association becomes something like below, which looks real.
Besides, socket/cluster/core/thread IDs are all checked when
the NUMA node IDs are verified. It helps to check if the CPU
topology is properly populated or not.

    NUMA-node  socket  cluster   core   thread
    ------------------------------------------
       0        1        0        0       0
       1        0        0        0       0

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20220503140304.855514-5-gshan@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/qtest/numa-test.c