mbox series

[v6,0/5] hw/arm/virt: Introduce cpu topology support

Message ID 20210824122016.144364-1-wangyanan55@huawei.com
Headers show
Series hw/arm/virt: Introduce cpu topology support | expand

Message

wangyanan (Y) Aug. 24, 2021, 12:20 p.m. UTC
This new version is based on patch series [1] which introduces some
fix and improvement for smp parsing.

Description:
Once the view of an accurate virtual cpu topology is provided to guest,
with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
e.g., the scheduling performance improvement. See Dario Faggioli's
research and the related performance tests in [2] for reference.

This patch series introduces cpu topology support for ARM platform.
Both cpu-map in DT and ACPI PPTT table are introduced to store the
topology information. And we only describe the topology information
to 6.2 and newer virt machines, considering compatibility.

patches not yet reviewed: #1 and #3.

[1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
[2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
-friend-or-foe-dario-faggioli-suse

---

Changelogs:

v5->v6:
- update the comment in DT cpu-map generation
- update the comment in ACPI PPTT table generation
- add R-b tags from Michael for ACPI patches
- v5: https://lore.kernel.org/qemu-devel/20210805123921.62540-1-wangyanan55@huawei.com/

v4->v5:
- drop the added -smp "expose=on|off" parameter and only describe topology
  for 6.2 and newer machines
- v4: https://lore.kernel.org/qemu-devel/20210622093413.13360-1-wangyanan55@huawei.com/

v3->v4:
- add new -smp parameter "expose=on|off" for users to enable/disable the feature
- add stricter -smp cmdline parsing rules on "expose=on" case
- move build_pptt to generic aml-build.c
- add default cluster node in the cpu-map
- rebase on top of latest upstream master
- v3: https://lore.kernel.org/qemu-devel/20210516102900.28036-1-wangyanan55@huawei.com/

v2->v3:
- address comments from David, Philippe, and Andrew. Thanks!
- split some change into separate commits for ease of review
- adjust parsing rules of virt_smp_parse to be more strict
  (after discussion with Andrew)
- adjust author credit for the patches
- v2: https://lore.kernel.org/qemu-devel/20210413080745.33004-1-wangyanan55@huawei.com/

v1->v2:
- Address Andrew Jones's comments
- Address Michael S. Tsirkin's comments
- v1: https://lore.kernel.org/qemu-devel/20210225085627.2263-1-fangying1@huawei.com/

---

Andrew Jones (2):
  hw/arm/virt: Add cpu-map to device tree
  hw/acpi/aml-build: Generate PPTT table

Yanan Wang (3):
  hw/arm/virt: Only describe cpu topology since virt-6.2
  device_tree: Add qemu_fdt_add_path
  hw/acpi/aml-build: Add Processor hierarchy node structure

 hw/acpi/aml-build.c          | 86 ++++++++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c     |  8 +++-
 hw/arm/virt.c                | 73 +++++++++++++++++++++++++-----
 include/hw/acpi/aml-build.h  |  7 +++
 include/hw/arm/virt.h        |  4 +-
 include/sysemu/device_tree.h |  1 +
 softmmu/device_tree.c        | 44 +++++++++++++++++-
 7 files changed, 209 insertions(+), 14 deletions(-)

--
2.19.1

Comments

Peter Maydell Sept. 2, 2021, 3:56 p.m. UTC | #1
On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
>
> This new version is based on patch series [1] which introduces some
> fix and improvement for smp parsing.
>
> Description:
> Once the view of an accurate virtual cpu topology is provided to guest,
> with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
> e.g., the scheduling performance improvement. See Dario Faggioli's
> research and the related performance tests in [2] for reference.
>
> This patch series introduces cpu topology support for ARM platform.
> Both cpu-map in DT and ACPI PPTT table are introduced to store the
> topology information. And we only describe the topology information
> to 6.2 and newer virt machines, considering compatibility.
>
> patches not yet reviewed: #1 and #3.
>
> [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
> [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
> -friend-or-foe-dario-faggioli-suse


Hi; this series doesn't apply to current head-of-git. Is it
intended to be based on some other series ?

thanks
-- PMM
wangyanan (Y) Sept. 3, 2021, 7:05 a.m. UTC | #2
On 2021/9/2 23:56, Peter Maydell wrote:
> On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
>> This new version is based on patch series [1] which introduces some
>> fix and improvement for smp parsing.
>>
>> Description:
>> Once the view of an accurate virtual cpu topology is provided to guest,
>> with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
>> e.g., the scheduling performance improvement. See Dario Faggioli's
>> research and the related performance tests in [2] for reference.
>>
>> This patch series introduces cpu topology support for ARM platform.
>> Both cpu-map in DT and ACPI PPTT table are introduced to store the
>> topology information. And we only describe the topology information
>> to 6.2 and newer virt machines, considering compatibility.
>>
>> patches not yet reviewed: #1 and #3.
>>
>> [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
>> [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
>> -friend-or-foe-dario-faggioli-suse
>
> Hi; this series doesn't apply to current head-of-git. Is it
> intended to be based on some other series ?
>
Yes, it was based on the -smp parsing changes in [1] which hasn't been
picked yet. Given that [1] somehow affects the topology parsing results
which we will describe to guest, I think it may be better that [1] can be
merged first and then this series follows.

But actually the only conflict with current upstream is in patch#1 about
machine type compat, so I can also send a new version of this series
rebased on the latest upstream with minor update, if the precedence
consideration of the two series is not so necessary as I thought.

[1] 
https://lore.kernel.org/qemu-devel/20210902110330.18036-1-wangyanan55@huawei.com/

Thanks,
Yanan
.
Peter Maydell Sept. 3, 2021, 7:25 a.m. UTC | #3
On Fri, 3 Sept 2021 at 08:05, wangyanan (Y) <wangyanan55@huawei.com> wrote:
>
>
> On 2021/9/2 23:56, Peter Maydell wrote:
> > On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
> >> This new version is based on patch series [1] which introduces some
> >> fix and improvement for smp parsing.
> >>
> >> Description:
> >> Once the view of an accurate virtual cpu topology is provided to guest,
> >> with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
> >> e.g., the scheduling performance improvement. See Dario Faggioli's
> >> research and the related performance tests in [2] for reference.
> >>
> >> This patch series introduces cpu topology support for ARM platform.
> >> Both cpu-map in DT and ACPI PPTT table are introduced to store the
> >> topology information. And we only describe the topology information
> >> to 6.2 and newer virt machines, considering compatibility.
> >>
> >> patches not yet reviewed: #1 and #3.
> >>
> >> [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
> >> [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
> >> -friend-or-foe-dario-faggioli-suse
> >
> > Hi; this series doesn't apply to current head-of-git. Is it
> > intended to be based on some other series ?
> >
> Yes, it was based on the -smp parsing changes in [1] which hasn't been
> picked yet. Given that [1] somehow affects the topology parsing results
> which we will describe to guest, I think it may be better that [1] can be
> merged first and then this series follows.

OK. I'll ignore this for now; please resend once that other series
has been accepted.

thanks
-- PMM
wangyanan (Y) Sept. 3, 2021, 7:38 a.m. UTC | #4
On 2021/9/3 15:25, Peter Maydell wrote:
> On Fri, 3 Sept 2021 at 08:05, wangyanan (Y) <wangyanan55@huawei.com> wrote:
>>
>> On 2021/9/2 23:56, Peter Maydell wrote:
>>> On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
>>>> This new version is based on patch series [1] which introduces some
>>>> fix and improvement for smp parsing.
>>>>
>>>> Description:
>>>> Once the view of an accurate virtual cpu topology is provided to guest,
>>>> with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
>>>> e.g., the scheduling performance improvement. See Dario Faggioli's
>>>> research and the related performance tests in [2] for reference.
>>>>
>>>> This patch series introduces cpu topology support for ARM platform.
>>>> Both cpu-map in DT and ACPI PPTT table are introduced to store the
>>>> topology information. And we only describe the topology information
>>>> to 6.2 and newer virt machines, considering compatibility.
>>>>
>>>> patches not yet reviewed: #1 and #3.
>>>>
>>>> [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
>>>> [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
>>>> -friend-or-foe-dario-faggioli-suse
>>> Hi; this series doesn't apply to current head-of-git. Is it
>>> intended to be based on some other series ?
>>>
>> Yes, it was based on the -smp parsing changes in [1] which hasn't been
>> picked yet. Given that [1] somehow affects the topology parsing results
>> which we will describe to guest, I think it may be better that [1] can be
>> merged first and then this series follows.
> OK. I'll ignore this for now; please resend once that other series
> has been accepted.
Got it.

Thanks,
Yanan
> thanks
> -- PMM
>
> .
Andrew Jones Sept. 6, 2021, 4:15 p.m. UTC | #5
On Fri, Sep 03, 2021 at 03:38:13PM +0800, wangyanan (Y) wrote:
> 
> On 2021/9/3 15:25, Peter Maydell wrote:
> > On Fri, 3 Sept 2021 at 08:05, wangyanan (Y) <wangyanan55@huawei.com> wrote:
> > > 
> > > On 2021/9/2 23:56, Peter Maydell wrote:
> > > > On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
> > > > > This new version is based on patch series [1] which introduces some
> > > > > fix and improvement for smp parsing.
> > > > > 
> > > > > Description:
> > > > > Once the view of an accurate virtual cpu topology is provided to guest,
> > > > > with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
> > > > > e.g., the scheduling performance improvement. See Dario Faggioli's
> > > > > research and the related performance tests in [2] for reference.
> > > > > 
> > > > > This patch series introduces cpu topology support for ARM platform.
> > > > > Both cpu-map in DT and ACPI PPTT table are introduced to store the
> > > > > topology information. And we only describe the topology information
> > > > > to 6.2 and newer virt machines, considering compatibility.
> > > > > 
> > > > > patches not yet reviewed: #1 and #3.
> > > > > 
> > > > > [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
> > > > > [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
> > > > > -friend-or-foe-dario-faggioli-suse
> > > > Hi; this series doesn't apply to current head-of-git. Is it
> > > > intended to be based on some other series ?
> > > > 
> > > Yes, it was based on the -smp parsing changes in [1] which hasn't been
> > > picked yet. Given that [1] somehow affects the topology parsing results
> > > which we will describe to guest, I think it may be better that [1] can be
> > > merged first and then this series follows.
> > OK. I'll ignore this for now; please resend once that other series
> > has been accepted.
> Got it.

Also, you'll likely want to rebase on Igor's acpi refactor series[*]

[*] https://www.mail-archive.com/qemu-devel@nongnu.org/msg822151.html

Thanks,
drew

> 
> Thanks,
> Yanan
> > thanks
> > -- PMM
> > 
> > .
>
wangyanan (Y) Sept. 7, 2021, 9:12 a.m. UTC | #6
On 2021/9/7 0:15, Andrew Jones wrote:
> On Fri, Sep 03, 2021 at 03:38:13PM +0800, wangyanan (Y) wrote:
>> On 2021/9/3 15:25, Peter Maydell wrote:
>>> On Fri, 3 Sept 2021 at 08:05, wangyanan (Y) <wangyanan55@huawei.com> wrote:
>>>> On 2021/9/2 23:56, Peter Maydell wrote:
>>>>> On Tue, 24 Aug 2021 at 13:20, Yanan Wang <wangyanan55@huawei.com> wrote:
>>>>>> This new version is based on patch series [1] which introduces some
>>>>>> fix and improvement for smp parsing.
>>>>>>
>>>>>> Description:
>>>>>> Once the view of an accurate virtual cpu topology is provided to guest,
>>>>>> with a well-designed vCPU pinning to the pCPU we may get a huge benefit,
>>>>>> e.g., the scheduling performance improvement. See Dario Faggioli's
>>>>>> research and the related performance tests in [2] for reference.
>>>>>>
>>>>>> This patch series introduces cpu topology support for ARM platform.
>>>>>> Both cpu-map in DT and ACPI PPTT table are introduced to store the
>>>>>> topology information. And we only describe the topology information
>>>>>> to 6.2 and newer virt machines, considering compatibility.
>>>>>>
>>>>>> patches not yet reviewed: #1 and #3.
>>>>>>
>>>>>> [1] https://lore.kernel.org/qemu-devel/20210823122804.7692-1-wangyanan55@huawei.com/
>>>>>> [2] https://kvmforum2020.sched.com/event/eE1y/virtual-topology-for-virtual-machines
>>>>>> -friend-or-foe-dario-faggioli-suse
>>>>> Hi; this series doesn't apply to current head-of-git. Is it
>>>>> intended to be based on some other series ?
>>>>>
>>>> Yes, it was based on the -smp parsing changes in [1] which hasn't been
>>>> picked yet. Given that [1] somehow affects the topology parsing results
>>>> which we will describe to guest, I think it may be better that [1] can be
>>>> merged first and then this series follows.
>>> OK. I'll ignore this for now; please resend once that other series
>>> has been accepted.
>> Got it.
> Also, you'll likely want to rebase on Igor's acpi refactor series[*]
>
> [*] https://www.mail-archive.com/qemu-devel@nongnu.org/msg822151.html
>
Ok, sure. I can wait for a while and will rebase the ACPI changes on Igor's
series for next version.

Thanks,
Yanan