|
From: Ryan H. <ry...@us...> - 2008-04-29 15:10:53
|
* Anthony Liguori <ali...@us...> [2008-04-28 17:30]: > We hold qemu_mutex while machine->init() executes, which issues a VCPU create. > We need to make sure to not return from the VCPU creation until the VCPU > file descriptor is valid to ensure that APIC creation succeeds. > > However, we also need to make sure that the VCPU thread doesn't start running > until the machine->init() is complete. This is addressed today because the > VCPU thread tries to grab the qemu_mutex before doing anything interesting. > If we release qemu_mutex to wait for VCPU creation, then we open a window for > a race to occur. > > This patch introduces two wait conditions. The first lets the VCPU create > code that runs in the IO thread to wait for a VCPU to initialize. The second > condition lets the VCPU thread wait for the machine to fully initialize before > running. > > An added benefit of this patch is it makes the dependencies now explicit. > > Signed-off-by: Anthony Liguori <ali...@us...> This patch passed the same tests I used on the other: 64 1VCPU guest launch, 1 second apart, and a 16-way SMP guest boot. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ry...@us... |