qemu-system-x86_64 takes 100% CPU
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have rhel6 inside qemu VM. qemu process starts to take CPU cycles and OS inside VM is very slow and sluggish.
the qemu version is the latest upstream git.
the kernel version is 3.12.0.
linux-0rsg:
Linux linux-0rsg 3.12.0-
linux-0rsg:
QEMU emulator version 1.6.50, Copyright (c) 2003-2008 Fabrice Bellard
the command line of qemu is below:
chenlidong@
root 19030 1 14 19:00 ? 00:04:24 /usr/local/
i used perf top, the result is below:
Samples: 57K of event 'cycles', Event count (approx.): 26336443124
15.38% perf-22465.map [.] 0x00007f143b99c9c6
5.90% qemu-system-x86_64 [.] phys_page_find
4.48% qemu-system-x86_64 [.] address_
3.30% qemu-system-x86_64 [.] compute_all_subw
3.15% qemu-system-x86_64 [.] check_regs
2.56% qemu-system-x86_64 [.] tb_find_fast
2.34% qemu-system-x86_64 [.] tb_find_slow
2.16% qemu-system-x86_64 [.] cpu_x86_
2.05% qemu-system-x86_64 [.] address_
1.66% qemu-system-x86_64 [.] cpu_x86_exec
1.55% qemu-system-x86_64 [.] address_
1.54% qemu-system-x86_64 [.] lshift
1.29% qemu-system-x86_64 [.] int128_make64
1.27% qemu-system-x86_64 [.] helper_
1.23% qemu-system-x86_64 [.] memory_
1.23% qemu-system-x86_64 [.] int128_sub
1.22% qemu-system-x86_64 [.] cpu_get_
1.19% qemu-system-x86_64 [.] lduw_p
1.17% qemu-system-x86_64 [.] tcg_constant_
1.16% qemu-system-x86_64 [.] ldq_phys_internal
1.09% qemu-system-x86_64 [.] int128_min
1.08% qemu-system-x86_64 [.] tlb_set_page
1.02% qemu-system-x86_64 [.] ldq_p
0.90% qemu-system-x86_64 [.] tb_jmp_
0.79% qemu-system-x86_64 [.] cpu_tb_exec
0.77% qemu-system-x86_64 [.] qemu_get_ram_ptr
0.75% qemu-system-x86_64 [.] helper_ret_lduw_mmu
0.75% qemu-system-x86_64 [.] qemu_get_ram_block
0.67% qemu-system-x86_64 [.] tcg_liveness_
0.67% qemu-system-x86_64 [.] int128_get64
0.66% qemu-system-x86_64 [.] tcg_reg_alloc_op
0.66% qemu-system-x86_64 [.] reset_all_temps
0.64% qemu-system-x86_64 [.] int128_ge
0.61% qemu-system-x86_64 [.] tcg_out_opc
0.59% qemu-system-x86_64 [.] qemu_loglevel_mask
0.54% qemu-system-x86_64 [.] int128_le
0.53% qemu-system-x86_64 [.] tcg_out8
0.52% qemu-system-x86_64 [.] ldq_le_p
0.48% qemu-system-x86_64 [.] xen_enabled
0.47% qemu-system-x86_64 [.] ldq_phys
0.46% qemu-system-x86_64 [.] memory_
0.44% qemu-system-x86_64 [.] memory_
0.44% qemu-system-x86_64 [.] memory_
0.44% qemu-system-x86_64 [.] tcg_gen_code_common
0.43% qemu-system-x86_64 [.] cpu_physical_
in most time, the funcation tb_find_slow used most cpu resource. and i used gdb print the stack.
(gdb) bt
#0 0x00007f54128cff5d in tb_find_slow (env=0x7f5413a1
#1 0x00007f54128d0199 in tb_find_fast (env=0x7f5413a1
#2 0x00007f54128d0950 in cpu_x86_exec (env=0x7f5413a1
#3 0x00007f54128d39d8 in tcg_cpu_exec (env=0x7f5413a1
#4 0x00007f54128d3aef in tcg_exec_all () at /home/chenlidon
#5 0x00007f54128d2ebc in qemu_tcg_
#6 0x00007f541047de0f in start_thread () from /lib64/
#7 0x00007f54101b17dd in clone () from /lib64/libc.so.6
i used the old version of qemu. when the vm is booting, the cpu is still 100%.
but the time of guest os boot is 2min50seconds. the latest upstream is7min21seconds.
so i think this is a performance problem.
the old version i used: linux-0rsg: ~> qemu-kvm --version
chenlidong@
QEMU emulator version 1.3.1 (kvm-1.3.1-3.6.2), Copyright (c) 2003-2008 Fabrice Bellard
there are so many modification between the two version.
i will test the other version to find out which modification cause this problem.