qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 35/43] tcg: allocate optimizer temps with tcg


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 35/43] tcg: allocate optimizer temps with tcg_malloc
Date: Fri, 21 Jul 2017 11:31:37 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/20/2017 07:59 PM, Emilio G. Cota wrote:
Groundwork for supporting multiple TCG contexts.

While at it, also allocate temps_used directly as a bitmap of the
required size, instead of using a bitmap of TCG_MAX_TEMPS via
TCGTempSet.

Performance-wise we lose about 1.12% in a translation-heavy workload
such as booting+shutting down debian-arm:

Performance counter stats for 'taskset -c 0 arm-softmmu/qemu-system-arm \
        -machine type=virt -nographic -smp 1 -m 4096 \
        -netdev user,id=unet,hostfwd=tcp::2222-:22 \
        -device virtio-net-device,netdev=unet \
        -drive file=die-on-boot.qcow2,id=myblock,index=0,if=none \
        -device virtio-blk-device,drive=myblock \
        -kernel kernel.img -append console=ttyAMA0 root=/dev/vda1 \
        -name arm,debug-threads=on -smp 1' (10 runs):

              exec time (s)  Relative slowdown wrt original (%)
---------------------------------------------------------------
  original     20.213321616                                  0.
  tcg_malloc   20.441130078                           1.1270214
  TCGContext   20.477846517                           1.3086662
  g_malloc     20.780527895                           2.8061013

The other two alternatives shown in the table are:
- TCGContext: embed temps[TCG_MAX_TEMPS] and TCGTempSet used_temps
   in TCGContext. This is simple enough but it isn't faster than using
   tcg_malloc; moreover, it wastes memory.
- g_malloc: allocate/deallocate both temps and used_temps every time
   tcg_optimize is executed.

Suggested-by: Richard Henderson<address@hidden>
Signed-off-by: Emilio G. Cota<address@hidden>
---
  tcg/optimize.c | 306 ++++++++++++++++++++++++++++++---------------------------
  1 file changed, 161 insertions(+), 145 deletions(-)

Reviewed-by: Richard Henderson <address@hidden>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]