I think the locking range of qemu_global_mutex is too large when do qmp operation. what
does the qemu_global_mutex really protect? what is the risk of unlocking qemu_global_mutex
in qmp? On 2019/6/10 21:51, Paolo Bonzini wrote:
On 10/06/19 15:34, Zhengui li wrote:when do qmp sush as drive_add, qemu main thread locks the qemu_global_mutex and do pread in raw_probe_alignmen. Pread is a synchronous operation. If backend storage network has a large delay or IO pressure is too large, the pread operation will not return for a long time, which make vcpu thread can't acquire qemu_global_mutex for a long time and make the vcpu thread unable to be scheduled for a long time. So virtual machine cpu soft lockup happened. qemu main thread should not hold qemu_global_mutex for a long time when do qmp that involving IO synchronous operation sush pread , ioctl, etc. So this patch unlock qemu_global_mutex before IO synchronous operation sush pread.These preads are for 512-4096 bytes, can they really last much longer than the "open" that precedes them? If pread of 4K can trigger a soft lockup, things are really screwed up---and it's hard to be sure that all callers of raw_probe_alignment are okay with releasing the global mutex. Paolo .
<<attachment: lizhengui.vcf>>