Anton Ivanov
Anton Ivanov

Reputation: 86

5 QEMU threads to serve a single vcpu VM: what is their purpose?

I create a virtual machine with 1 vCPU, 1 disk and 1 tap connection using this command:

qemu-system-x86_64 -vnc :1 -smp 1 -device virtio-blk-pci,id=blk0,bootindex=0,drive=hd0,scsi=off -drive file=build/last/vm.img,if=none,id=hd0 -netdev tap,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic0 -enable-kvm -chardev stdio,mux=on,id=stdio,signal=on -mon chardev=stdio,mode=readline,default -device isa-serial,chardev=stdio

after that, when I run top I can see 5 'qemu-system-x86_64' threads with different PIDs.

All I managed to find myself is that besides the main thread, there is a thread for every vCPU and an I/O thread. But still that explains just 3 threads. What are the other 2 doing?

Can anyone explain what do these 5 QEMU threads do?

Upvotes: 1

Views: 653

Answers (1)

RampantBadger
RampantBadger

Reputation: 21

I think I read on this forum somewhere that I/O in qemu is multi-threaded which may explain it

Upvotes: 1

Related Questions