qemu-user-linux: how could I measure performance for aarch64 and arm?
Hello,
I am running the same application compiled for aarch64 and armv7l on x86_64 platform using qemu-user-linux tools.
I see dramatic performance difference (30 times) between emulated
architectures: aarch64 runs for ~4 minutes, armv7l runs for ~2 hours. I do understand that CPU architecture emulation is inherently slow thing, but my question is about the difference.
How could I debug to understand what is the reason for such a big difference? I've already tried to run stress-ng compiled for this two architectures, but it leads to the same performance per second.
I am running qemu 2.11, should I try other version?
Quoted 8 lines · Matwey V. Kornilov
I am running the same application compiled for aarch64 and armv7l on
x86_64platform using qemu-user-linux tools.I see dramatic performance difference (30 times) between emulated
architectures: aarch64 runs for ~4 minutes, armv7l runs for ~2 hours. I do understand that CPU architecture emulation is inherently slow thing, but my question is about the difference.
Quoted 5 lines
How could I debug to understand what is the reason for such a big difference? I've already tried to run stress-ng compiled for this two architectures, but it leads to the same performance per second.
I am running qemu 2.11, should I try other version?
Yes, do try 3.1 -- we have done some overall TCG performance improvements.
For a big difference between target architectures like that, I would try starting by using some host performance tools on the two runs to see where all the time is being taken in the armv7l guest run -- is it all in translated guest code, or is there more time (proportionally) spent in particular parts of the QEMU C code? Does the armv7l version do many more or different syscalls (check with the QEMU -strace option) ?
Also you should check performance on h/w 32 bit vs 64-bit Arm if you can, to confirm that it's not just that the guest application runs much slower there. (If you don't have the arm hardware you could at least check x86 32-bit vs 64-bit.)
thanks
-- PMM
пт, 11 янв. 2019 г. в 12:52, Peter Maydell <[email protected]>:
Quoted 11 lines
Quoted 8 lines · Matwey V. Kornilov
I am running the same application compiled for aarch64 and armv7l on
x86_64platform using qemu-user-linux tools.I see dramatic performance difference (30 times) between emulated
architectures: aarch64 runs for ~4 minutes, armv7l runs for ~2 hours. I do understand that CPU architecture emulation is inherently slow thing, but my question is about the difference.
Quoted 8 lines
Quoted 5 lines
How could I debug to understand what is the reason for such a big difference? I've already tried to run stress-ng compiled for this two architectures, but it leads to the same performance per second.
I am running qemu 2.11, should I try other version?
Yes, do try 3.1 -- we have done some overall TCG performance improvements.
Indeed, qemu-arm from master runs for 4 minutes where 2.11 runs for 2 hours for me. It is impressive improvement.
Quoted 18 lines
For a big difference between target architectures like that, I would try starting by using some host performance tools on the two runs to see where all the time is being taken in the armv7l guest run -- is it all in translated guest code, or is there more time (proportionally) spent in particular parts of the QEMU C code? Does the armv7l version do many more or different syscalls (check with the QEMU -strace option) ?
Also you should check performance on h/w 32 bit vs 64-bit Arm if you can, to confirm that it's not just that the guest application runs much slower there. (If you don't have the arm hardware you could at least check x86 32-bit vs 64-bit.)
thanks
-- PMM
Signature · 2 lines
With best regards, Matwey V. Kornilov
пт, 11 янв. 2019 г. в 22:24, Matwey V. Kornilov <[email protected]>:
Quoted 17 lines
пт, 11 янв. 2019 г. в 12:52, Peter Maydell <[email protected]>:
Quoted 15 lines
Quoted 12 lines · Matwey V. Kornilov
I am running the same application compiled for aarch64 and armv7l on
x86_64platform using qemu-user-linux tools.I see dramatic performance difference (30 times) between emulated
architectures: aarch64 runs for ~4 minutes, armv7l runs for ~2 hours. I do understand that CPU architecture emulation is inherently slow thing, but my question is about the difference.How could I debug to understand what is the reason for such a big difference? I've already tried to run stress-ng compiled for this two architectures, but it leads to the same performance per second.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I am running qemu 2.11, should I try other version?
Yes, do try 3.1 -- we have done some overall TCG performance improvements.
Indeed, qemu-arm from master runs for 4 minutes where 2.11 runs for 2 hours for me. It is impressive improvement.
I've managed to bisected the first good (fast) commit:
commit 2a53535af471f4bee9d6cb5b363746b8d5ed21dd
Author: Luke Shumaker <[email protected]> Date: Thu Dec 28 13:08:13 2017 -0500
linux-user: init_guest_space: Try to make ARM space+commpage continuous
Though I am not sure, how does it help.
Quoted 25 lines
Quoted 11 lines
For a big difference between target architectures like that, I would try starting by using some host performance tools on the two runs to see where all the time is being taken in the armv7l guest run -- is it all in translated guest code, or is there more time (proportionally) spent in particular parts of the QEMU C code? Does the armv7l version do many more or different syscalls (check with the QEMU -strace option) ?
Quoted 8 lines
Also you should check performance on h/w 32 bit vs 64-bit Arm if you can, to confirm that it's not just that the guest application runs much slower there. (If you don't have the arm hardware you could at least check x86 32-bit vs 64-bit.)
thanks
-- PMM--
With best regards,
Matwey V. Kornilov
Signature · 2 lines
With best regards, Matwey V. Kornilov
Quoted 7 lines · Matwey V. Kornilov
пт, 11 янв. 2019 г. в 22:24, Matwey V. Kornilov <[email protected]>:
Quoted 2 lines
Indeed, qemu-arm from master runs for 4 minutes where 2.11 runs for 2 hours for me. It is impressive improvement.
I've managed to bisected the first good (fast) commit:
Quoted 7 lines
commit
2a53535af471f4bee9d6cb5b363746b8d5ed21ddAuthor: Luke Shumaker <[email protected]> Date: Thu Dec 28 13:08:13 2017 -0500linux-user:
init_guest_space: Try to make ARM space+commpage continuousThough I am not sure, how does it help.
Oh, right, you were running into that bug:
https://bugs.launchpad.net/qemu/+bug/1740219
The problem was that we were not putting things in the right place in memory for 32-bit Arm guest binaries in particular, which could mean that we spent a long time trying a lot of placements for memory mappings that failed instead of getting an arrangement that worked first time. This meant startup time for the guest binary was pretty slow. I guess your application does a lot of exec()ing of new processes?
thanks
-- PMM
пн, 14 янв. 2019 г. в 13:24, Peter Maydell <[email protected]>:
Quoted 21 lines
Quoted 7 lines · Matwey V. Kornilov
пт, 11 янв. 2019 г. в 22:24, Matwey V. Kornilov <[email protected]>:
Quoted 2 lines
Indeed, qemu-arm from master runs for 4 minutes where 2.11 runs for 2 hours for me. It is impressive improvement.
I've managed to bisected the first good (fast) commit:
Quoted 7 lines
commit
2a53535af471f4bee9d6cb5b363746b8d5ed21ddAuthor: Luke Shumaker <[email protected]> Date: Thu Dec 28 13:08:13 2017 -0500linux-user:
init_guest_space: Try to make ARM space+commpage continuousThough I am not sure, how does it help.
Oh, right, you were running into that bug:
https://bugs.launchpad.net/qemu/+bug/1740219
Quoted 7 lines
The problem was that we were not putting things in the right place in memory for 32-bit Arm guest binaries in particular, which could mean that we spent a long time trying a lot of placements for memory mappings that failed instead of getting an arrangement that worked first time. This meant startup time for the guest binary was pretty slow. I guess your application does a lot of exec()ing of new processes?
Indeed. Thank you.
Quoted 3 lines
thanks
-- PMM
Signature · 2 lines
With best regards, Matwey V. Kornilov