On Wed, May 13, 2009 at 10:07:54AM +0800, Yang, Sheng wrote: > > KVM: workaround workqueue / deassign_host_irq deadlock > > > > I think I'm running into the following deadlock in the kvm kernel module > > when trying to use device assignment: > > > > CPU A CPU B > > kvm_vm_ioctl_deassign_dev_irq() > > mutex_lock(&kvm->lock); worker_thread() > > -> kvm_deassign_irq() -> > > kvm_assigned_dev_interrupt_work_handler() > > -> deassign_host_irq() mutex_lock(&kvm->lock); > > -> cancel_work_sync() [blocked] > > > > Workaround the issue by dropping kvm->lock for cancel_work_sync(). > > > > Reported-by: Alex Williamson <alex.williamson@xxxxxx> > > From: Sheng Yang <sheng.yang@xxxxxxxxx> > > Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx> > > Another calling path(kvm_free_all_assigned_devices()) don't hold kvm->lock... > Seems it need the lock for travel assigned dev list? Sheng, The task executing the deassign irq ioctl has a reference to the vm instance. This solution is just temporary though until the locks can be split and then dropping kvm->lock around cancel_work_sync will not be necessary anymore. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html