mbox series

[v4,0/6] Only generate cluster node in PPTT when specified

Message ID 20221101071048.29553-1-yangyicong@huawei.com (mailing list archive)
Headers show
Series Only generate cluster node in PPTT when specified | expand

Message

Yicong Yang Nov. 1, 2022, 7:10 a.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com>

This series mainly change the policy for building a cluster topology node
in PPTT. Previously we'll always build a cluster node in PPTT without
asking the user, after this set the cluster node will be built only the
the user specify through "-smp clusters=X".

One problem is related to this but not fully caused by this, see the
discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
the linux scheduling domains in the VM misses the NUMA domains. It's
because the MC level span extends to Cluster level (which is generated
by the Qemu by default) that spans all the cpus in the system, then the
scheduling domain building stops at MC level since it already includes all
the cpus.

Considering cluster is an optional level and most platforms don't have it,
they may even don't realize this is built and a always build policy cannot
emulate the real topology on these platforms. So in this series improve the
policy to only generate cluster when the user explicitly want it.

Update the tests and test tables accordingly.

[*] https://lore.kernel.org/lkml/2c079860-ee82-7719-d3d2-756192f41704@huawei.com/

Change since v3:
- Improve and attach the diff of the affected ACPI tables in the commit, and minor cleanups
Link: https://lore.kernel.org/qemu-devel/20221031090523.34146-1-yangyicong@huawei.com/

Change since v2:
- Add tag from Micheal, thanks
- Handle the tests changes with bios-tables-test-allowed-diff.h, Per Micheal
- Address the comments per Yanan
Link: https://lore.kernel.org/qemu-devel/20221027032613.18377-1-yangyicong@huawei.com/

Change since v1:
- Only includes the test tables which is really needed
- Enrich the commit
Link: https://lore.kernel.org/qemu-devel/20220922131143.58003-1-yangyicong@huawei.com/

Yicong Yang (6):
  tests: virt: Allow changes to PPTT test table
  hw/acpi/aml-build: Only generate cluster node in PPTT when specified
  tests: virt: Update expected ACPI tables for virt test
  tests: acpi: Add and whitelist *.topology blobs
  tests: acpi: aarch64: Add topology test for aarch64
  tests: acpi: aarch64: Add *.topology tables

 hw/acpi/aml-build.c                |   2 +-
 hw/core/machine-smp.c              |   2 ++
 include/hw/boards.h                |   3 +++
 qemu-options.hx                    |   3 +++
 tests/data/acpi/virt/APIC.topology | Bin 0 -> 700 bytes
 tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes
 tests/data/acpi/virt/PPTT          | Bin 96 -> 76 bytes
 tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes
 tests/qtest/bios-tables-test.c     |  19 +++++++++++++++++++
 9 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 tests/data/acpi/virt/APIC.topology
 create mode 100644 tests/data/acpi/virt/DSDT.topology
 create mode 100644 tests/data/acpi/virt/PPTT.topology

Comments

Michael S. Tsirkin Nov. 2, 2022, 8:17 a.m. UTC | #1
On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> This series mainly change the policy for building a cluster topology node
> in PPTT. Previously we'll always build a cluster node in PPTT without
> asking the user, after this set the cluster node will be built only the
> the user specify through "-smp clusters=X".
> 
> One problem is related to this but not fully caused by this, see the
> discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
> the linux scheduling domains in the VM misses the NUMA domains. It's
> because the MC level span extends to Cluster level (which is generated
> by the Qemu by default) that spans all the cpus in the system, then the
> scheduling domain building stops at MC level since it already includes all
> the cpus.
> 
> Considering cluster is an optional level and most platforms don't have it,
> they may even don't realize this is built and a always build policy cannot
> emulate the real topology on these platforms. So in this series improve the
> policy to only generate cluster when the user explicitly want it.
> 
> Update the tests and test tables accordingly.

I think we can classify this as a bugfix and so allow after
the freeze, however, this needs ack from ARM maintainers then.


> [*] https://lore.kernel.org/lkml/2c079860-ee82-7719-d3d2-756192f41704@huawei.com/
> 
> Change since v3:
> - Improve and attach the diff of the affected ACPI tables in the commit, and minor cleanups
> Link: https://lore.kernel.org/qemu-devel/20221031090523.34146-1-yangyicong@huawei.com/
> 
> Change since v2:
> - Add tag from Micheal, thanks
> - Handle the tests changes with bios-tables-test-allowed-diff.h, Per Micheal
> - Address the comments per Yanan
> Link: https://lore.kernel.org/qemu-devel/20221027032613.18377-1-yangyicong@huawei.com/
> 
> Change since v1:
> - Only includes the test tables which is really needed
> - Enrich the commit
> Link: https://lore.kernel.org/qemu-devel/20220922131143.58003-1-yangyicong@huawei.com/
> 
> Yicong Yang (6):
>   tests: virt: Allow changes to PPTT test table
>   hw/acpi/aml-build: Only generate cluster node in PPTT when specified
>   tests: virt: Update expected ACPI tables for virt test
>   tests: acpi: Add and whitelist *.topology blobs
>   tests: acpi: aarch64: Add topology test for aarch64
>   tests: acpi: aarch64: Add *.topology tables
> 
>  hw/acpi/aml-build.c                |   2 +-
>  hw/core/machine-smp.c              |   2 ++
>  include/hw/boards.h                |   3 +++
>  qemu-options.hx                    |   3 +++
>  tests/data/acpi/virt/APIC.topology | Bin 0 -> 700 bytes
>  tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes
>  tests/data/acpi/virt/PPTT          | Bin 96 -> 76 bytes
>  tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes
>  tests/qtest/bios-tables-test.c     |  19 +++++++++++++++++++
>  9 files changed, 28 insertions(+), 1 deletion(-)
>  create mode 100644 tests/data/acpi/virt/APIC.topology
>  create mode 100644 tests/data/acpi/virt/DSDT.topology
>  create mode 100644 tests/data/acpi/virt/PPTT.topology
> 
> -- 
> 2.24.0
Yicong Yang Nov. 3, 2022, 12:18 p.m. UTC | #2
On 2022/11/2 16:17, Michael S. Tsirkin wrote:
> On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong@hisilicon.com>
>>
>> This series mainly change the policy for building a cluster topology node
>> in PPTT. Previously we'll always build a cluster node in PPTT without
>> asking the user, after this set the cluster node will be built only the
>> the user specify through "-smp clusters=X".
>>
>> One problem is related to this but not fully caused by this, see the
>> discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
>> the linux scheduling domains in the VM misses the NUMA domains. It's
>> because the MC level span extends to Cluster level (which is generated
>> by the Qemu by default) that spans all the cpus in the system, then the
>> scheduling domain building stops at MC level since it already includes all
>> the cpus.
>>
>> Considering cluster is an optional level and most platforms don't have it,
>> they may even don't realize this is built and a always build policy cannot
>> emulate the real topology on these platforms. So in this series improve the
>> policy to only generate cluster when the user explicitly want it.
>>
>> Update the tests and test tables accordingly.
> 
> I think we can classify this as a bugfix and so allow after

Not quite sure about it as I regarded it as an improvement of the topology building
policy. And the problem I met is not directly caused by the policy before this series.

> the freeze, however, this needs ack from ARM maintainers then.

sure. Will resend after the freeze.

Thanks.

> 
> 
>> [*] https://lore.kernel.org/lkml/2c079860-ee82-7719-d3d2-756192f41704@huawei.com/
>>
>> Change since v3:
>> - Improve and attach the diff of the affected ACPI tables in the commit, and minor cleanups
>> Link: https://lore.kernel.org/qemu-devel/20221031090523.34146-1-yangyicong@huawei.com/
>>
>> Change since v2:
>> - Add tag from Micheal, thanks
>> - Handle the tests changes with bios-tables-test-allowed-diff.h, Per Micheal
>> - Address the comments per Yanan
>> Link: https://lore.kernel.org/qemu-devel/20221027032613.18377-1-yangyicong@huawei.com/
>>
>> Change since v1:
>> - Only includes the test tables which is really needed
>> - Enrich the commit
>> Link: https://lore.kernel.org/qemu-devel/20220922131143.58003-1-yangyicong@huawei.com/
>>
>> Yicong Yang (6):
>>   tests: virt: Allow changes to PPTT test table
>>   hw/acpi/aml-build: Only generate cluster node in PPTT when specified
>>   tests: virt: Update expected ACPI tables for virt test
>>   tests: acpi: Add and whitelist *.topology blobs
>>   tests: acpi: aarch64: Add topology test for aarch64
>>   tests: acpi: aarch64: Add *.topology tables
>>
>>  hw/acpi/aml-build.c                |   2 +-
>>  hw/core/machine-smp.c              |   2 ++
>>  include/hw/boards.h                |   3 +++
>>  qemu-options.hx                    |   3 +++
>>  tests/data/acpi/virt/APIC.topology | Bin 0 -> 700 bytes
>>  tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes
>>  tests/data/acpi/virt/PPTT          | Bin 96 -> 76 bytes
>>  tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes
>>  tests/qtest/bios-tables-test.c     |  19 +++++++++++++++++++
>>  9 files changed, 28 insertions(+), 1 deletion(-)
>>  create mode 100644 tests/data/acpi/virt/APIC.topology
>>  create mode 100644 tests/data/acpi/virt/DSDT.topology
>>  create mode 100644 tests/data/acpi/virt/PPTT.topology
>>
>> -- 
>> 2.24.0
> 
> .
>
Peter Maydell Nov. 10, 2022, 1:10 p.m. UTC | #3
On Wed, 2 Nov 2022 at 08:17, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote:
> > From: Yicong Yang <yangyicong@hisilicon.com>
> >
> > This series mainly change the policy for building a cluster topology node
> > in PPTT. Previously we'll always build a cluster node in PPTT without
> > asking the user, after this set the cluster node will be built only the
> > the user specify through "-smp clusters=X".
> >
> > One problem is related to this but not fully caused by this, see the
> > discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
> > the linux scheduling domains in the VM misses the NUMA domains. It's
> > because the MC level span extends to Cluster level (which is generated
> > by the Qemu by default) that spans all the cpus in the system, then the
> > scheduling domain building stops at MC level since it already includes all
> > the cpus.
> >
> > Considering cluster is an optional level and most platforms don't have it,
> > they may even don't realize this is built and a always build policy cannot
> > emulate the real topology on these platforms. So in this series improve the
> > policy to only generate cluster when the user explicitly want it.
> >
> > Update the tests and test tables accordingly.
>
> I think we can classify this as a bugfix and so allow after
> the freeze, however, this needs ack from ARM maintainers then.

I don't use, test or understand any of the ACPI related code :-)
I'm happy to leave it up to your judgement whether this should go
into this release or wait for 8.0.

thanks
-- PMM
Michael S. Tsirkin Dec. 21, 2022, 6:27 a.m. UTC | #4
On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> This series mainly change the policy for building a cluster topology node
> in PPTT. Previously we'll always build a cluster node in PPTT without
> asking the user, after this set the cluster node will be built only the
> the user specify through "-smp clusters=X".
> 
> One problem is related to this but not fully caused by this, see the
> discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
> the linux scheduling domains in the VM misses the NUMA domains. It's
> because the MC level span extends to Cluster level (which is generated
> by the Qemu by default) that spans all the cpus in the system, then the
> scheduling domain building stops at MC level since it already includes all
> the cpus.
> 
> Considering cluster is an optional level and most platforms don't have it,
> they may even don't realize this is built and a always build policy cannot
> emulate the real topology on these platforms. So in this series improve the
> policy to only generate cluster when the user explicitly want it.
> 
> Update the tests and test tables accordingly.

To merge this to master we also need to update the new
tests/data/acpi/virt/PPTT.acpihmatvirt

I could do so myself but I'd rather you did the rebase and verified
the diff manually. If the diff is the same no need to update
commit log just the binaries.

Thanks!



> [*] https://lore.kernel.org/lkml/2c079860-ee82-7719-d3d2-756192f41704@huawei.com/
> 
> Change since v3:
> - Improve and attach the diff of the affected ACPI tables in the commit, and minor cleanups
> Link: https://lore.kernel.org/qemu-devel/20221031090523.34146-1-yangyicong@huawei.com/
> 
> Change since v2:
> - Add tag from Micheal, thanks
> - Handle the tests changes with bios-tables-test-allowed-diff.h, Per Micheal
> - Address the comments per Yanan
> Link: https://lore.kernel.org/qemu-devel/20221027032613.18377-1-yangyicong@huawei.com/
> 
> Change since v1:
> - Only includes the test tables which is really needed
> - Enrich the commit
> Link: https://lore.kernel.org/qemu-devel/20220922131143.58003-1-yangyicong@huawei.com/
> 
> Yicong Yang (6):
>   tests: virt: Allow changes to PPTT test table
>   hw/acpi/aml-build: Only generate cluster node in PPTT when specified
>   tests: virt: Update expected ACPI tables for virt test
>   tests: acpi: Add and whitelist *.topology blobs
>   tests: acpi: aarch64: Add topology test for aarch64
>   tests: acpi: aarch64: Add *.topology tables
> 
>  hw/acpi/aml-build.c                |   2 +-
>  hw/core/machine-smp.c              |   2 ++
>  include/hw/boards.h                |   3 +++
>  qemu-options.hx                    |   3 +++
>  tests/data/acpi/virt/APIC.topology | Bin 0 -> 700 bytes
>  tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes
>  tests/data/acpi/virt/PPTT          | Bin 96 -> 76 bytes
>  tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes
>  tests/qtest/bios-tables-test.c     |  19 +++++++++++++++++++
>  9 files changed, 28 insertions(+), 1 deletion(-)
>  create mode 100644 tests/data/acpi/virt/APIC.topology
>  create mode 100644 tests/data/acpi/virt/DSDT.topology
>  create mode 100644 tests/data/acpi/virt/PPTT.topology
> 
> -- 
> 2.24.0
Yicong Yang Dec. 21, 2022, 9:13 a.m. UTC | #5
On 2022/12/21 14:27, Michael S. Tsirkin wrote:
> On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong@hisilicon.com>
>>
>> This series mainly change the policy for building a cluster topology node
>> in PPTT. Previously we'll always build a cluster node in PPTT without
>> asking the user, after this set the cluster node will be built only the
>> the user specify through "-smp clusters=X".
>>
>> One problem is related to this but not fully caused by this, see the
>> discussion in [*]. When booting the VM with `-smp 8` and 4 numa nodes,
>> the linux scheduling domains in the VM misses the NUMA domains. It's
>> because the MC level span extends to Cluster level (which is generated
>> by the Qemu by default) that spans all the cpus in the system, then the
>> scheduling domain building stops at MC level since it already includes all
>> the cpus.
>>
>> Considering cluster is an optional level and most platforms don't have it,
>> they may even don't realize this is built and a always build policy cannot
>> emulate the real topology on these platforms. So in this series improve the
>> policy to only generate cluster when the user explicitly want it.
>>
>> Update the tests and test tables accordingly.
> 
> To merge this to master we also need to update the new
> tests/data/acpi/virt/PPTT.acpihmatvirt
> 
> I could do so myself but I'd rather you did the rebase and verified
> the diff manually. If the diff is the same no need to update
> commit log just the binaries.
> 

Thanks for the hint and reminder! Will rebase on the lastest and do the necessary
updates. Will send an updated version tomorrow or late this week.

Thanks,
Yicong

> 
> 
> 
>> [*] https://lore.kernel.org/lkml/2c079860-ee82-7719-d3d2-756192f41704@huawei.com/
>>
>> Change since v3:
>> - Improve and attach the diff of the affected ACPI tables in the commit, and minor cleanups
>> Link: https://lore.kernel.org/qemu-devel/20221031090523.34146-1-yangyicong@huawei.com/
>>
>> Change since v2:
>> - Add tag from Micheal, thanks
>> - Handle the tests changes with bios-tables-test-allowed-diff.h, Per Micheal
>> - Address the comments per Yanan
>> Link: https://lore.kernel.org/qemu-devel/20221027032613.18377-1-yangyicong@huawei.com/
>>
>> Change since v1:
>> - Only includes the test tables which is really needed
>> - Enrich the commit
>> Link: https://lore.kernel.org/qemu-devel/20220922131143.58003-1-yangyicong@huawei.com/
>>
>> Yicong Yang (6):
>>   tests: virt: Allow changes to PPTT test table
>>   hw/acpi/aml-build: Only generate cluster node in PPTT when specified
>>   tests: virt: Update expected ACPI tables for virt test
>>   tests: acpi: Add and whitelist *.topology blobs
>>   tests: acpi: aarch64: Add topology test for aarch64
>>   tests: acpi: aarch64: Add *.topology tables
>>
>>  hw/acpi/aml-build.c                |   2 +-
>>  hw/core/machine-smp.c              |   2 ++
>>  include/hw/boards.h                |   3 +++
>>  qemu-options.hx                    |   3 +++
>>  tests/data/acpi/virt/APIC.topology | Bin 0 -> 700 bytes
>>  tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes
>>  tests/data/acpi/virt/PPTT          | Bin 96 -> 76 bytes
>>  tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes
>>  tests/qtest/bios-tables-test.c     |  19 +++++++++++++++++++
>>  9 files changed, 28 insertions(+), 1 deletion(-)
>>  create mode 100644 tests/data/acpi/virt/APIC.topology
>>  create mode 100644 tests/data/acpi/virt/DSDT.topology
>>  create mode 100644 tests/data/acpi/virt/PPTT.topology
>>
>> -- 
>> 2.24.0
> 
> .
>