Skip to contentSkip to conversation

Multi process. using threads in qemu

Qemu-devel Alexandre Muller 2 participants 2 messages Mar 27, 2010

lore
Share & tools
lore
#0 lore raw

Hi Qemu developers, I use the Qemu emulator for years, and recently I experienced things that made me think. Specially in how to speed up the emulator (for example if I have a 32 bit x86 with 2 ou more processors emulating 64 bit processor).

First I noticed that even my virtual machine was very slow, my others applications were fine. Making top I saw that qemu consumes 100% of CPU, but I have 2 processors. Using a multithread app, is consumes 200%. So I think there is a way to double speed of emulation with some hack. I looked a little at qemu source code and I really have no Idea about the high level functionality of it. I think if I could find a main loop of "instructions execution" I can call thread for each processor and makes the control properly.

Lets go to questions that I have to do:
1 - The is a known discussion about it?
2 - There is a patch or a dirty and quick way to do it? (I not worried about safety)

Thanks for attention
Alexandre

#1 lore raw
Quoted 1 line · Alexandre Muller, le Fri 26 Mar 2010 21:26:52 -0300, a écrit :

1 - The is a known discussion about it?

Yes. The basic answer is: this is hard. You'd need to keep the memory coherency etc.

Quoted 2 lines

2 - There is a patch or a dirty and quick way to do it? (I not worried about safety)

Use kvm. In that case the CPU handles the memory coherency etc. and thus you do get parallelism.

Samuel