what's the "futex" thread doing when create a kvm guest ?

Amit Shah amitshah at gmx.net
Mon Feb 23 08:13:32 UTC 2015


On (Sun) 22 Feb 2015 [20:36:24], Hu Jun wrote:
> Hi guys:
> 
> env:
> [root at cloudf ~]# uname -a
> Linux cloudf.fedora.com 3.18.7-100.fc20.x86_64 #1 SMP Wed Feb 11 19:01:50
> UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
> [root at cloudf ~]# rpm -q qemu-kvm
> qemu-kvm-1.6.2-13.fc20.x86_64
> 
> I found there is a "futex" thead after creating a kvm guest by the
> command:"/usr/bin/qemu-system-x86_64 -machine accel=kvm -hda
> /opt/todaygoods_SLES_11_SP3_JeOS.x86_64-0.0.2.raw -vnc 192.168.0.110:6"
> 
> root at cloudf task]# ps aux | grep qemu
> root     13111  0.3  2.8 546760 227340 pts/3   S+   18:26   0:12 gdb
> qemu-system-x86_64
> root     14379 85.2  2.0 699004 165496 pts/3   tl   18:49  31:12
> /usr/bin/qemu-system-x86_64 -machine accel=kvm -hda
> /opt/todaygoods_SLES_11_SP3_JeOS.x86_64-0.0.2.raw -vnc 192.168.0.110:6
> 
> the process 14379 has three threads, I'm familiar with the two of them
> except the third thread (lwp :14418)
> 
> [root at cloudf 14379]# cd /proc/14379/
> [root at cloudf 14379]# cat task/14
> 14379/ 14416/ 14418/
> [root at cloudf 14379]# cat task/14379/stack
> [<ffffffff8121d1e9>] poll_schedule_timeout+0x49/0x70
> [<ffffffff8121e8e4>] do_sys_poll+0x484/0x5c0

so this is the main loop thread

> [<ffffffff8121eb24>] SyS_poll+0x74/0x110
> [<ffffffff8174cfa9>] system_call_fastpath+0x12/0x17
> [<ffffffffffffffff>] 0xffffffffffffffff
> [root at cloudf 14379]# cat task/14416/stack
> [<ffffffffa05cf92d>] kvm_arch_vcpu_ioctl_run+0xb0d/0x1280 [kvm]
> [<ffffffffa05b7bb2>] kvm_vcpu_ioctl+0x292/0x5c0 [kvm]

this is the guest vcpu thread

> [<ffffffff8121c710>] do_vfs_ioctl+0x2e0/0x4a0
> [<ffffffff8121c951>] SyS_ioctl+0x81/0xa0
> [<ffffffff8174cfa9>] system_call_fastpath+0x12/0x17
> [<ffffffffffffffff>] 0xffffffffffffffff
> [root at cloudf 14379]# cat task/14418/stack
> [<ffffffff8110b6e0>] futex_wait_queue_me+0xd0/0x130
> [<ffffffff8110b9e6>] futex_wait+0x176/0x270
> [<ffffffff8110dc7e>] do_futex+0x10e/0xac0

and this must be some thread -- like network or block, depending on
your qemu config.  The futex is via pthreads, so just looking at the
qemu code based on what config you're using will get you the answer.

> [<ffffffff8110e6b0>] SyS_futex+0x80/0x180
> [<ffffffff8174cfa9>] system_call_fastpath+0x12/0x17
> [<ffffffffffffffff>] 0xffffffffffffffff
> 
> what's the "futex" thread doing  when create a kvm guest ?  I deeped into
> the qemu code , but I failed to find where call "futex" system call.
> 
> can you help me ?

Anyway this is not relevant to the fedora kernel, you'll have more
luck on the qemu list or the fedora virt list.


		Amit
-- 
http://log.amitshah.net/


More information about the kernel mailing list