All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: device-assignment deadlock
@ 2009-05-12  9:05 Yang, Sheng
  2009-05-12  9:32 ` [PATCH 1/1] KVM: Fix potentially recursively get kvm lock Sheng Yang
  0 siblings, 1 reply; 17+ messages in thread
From: Yang, Sheng @ 2009-05-12  9:05 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm

[I was kicked off from the mailing list by periodic unknown reason last 
Friday... Sorry]

> Hi Sheng,
>
> 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]

> I wonder if we need finer granularity locking to avoid this.
> Suggestions?  Thanks,

This part again...

I think simply move kvm_deassign_irq() out of critical region is OK, and I 
also add the lock which seems missing in deassign_guest_irq(). Would post a 
patch soon.

-- 
regards
Yang, Sheng


^ permalink raw reply	[flat|nested] 17+ messages in thread
* device-assignment deadlock
@ 2009-05-08 22:21 Alex Williamson
  0 siblings, 0 replies; 17+ messages in thread
From: Alex Williamson @ 2009-05-08 22:21 UTC (permalink / raw)
  To: Sheng Yang; +Cc: kvm

Hi Sheng,

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]

I wonder if we need finer granularity locking to avoid this.
Suggestions?  Thanks,

Alex


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-05-22 15:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-12  9:05 device-assignment deadlock Yang, Sheng
2009-05-12  9:32 ` [PATCH 1/1] KVM: Fix potentially recursively get kvm lock Sheng Yang
2009-05-12 11:55   ` Marcelo Tosatti
2009-05-12 14:13     ` Yang, Sheng
2009-05-12 14:30       ` Marcelo Tosatti
2009-05-12 15:59         ` Marcelo Tosatti
2009-05-12 19:44         ` Marcelo Tosatti
2009-05-12 21:36           ` Alex Williamson
2009-05-12 22:09             ` Marcelo Tosatti
2009-05-12 22:17               ` Alex Williamson
2009-05-22 15:06                 ` Chris Wright
2009-05-22 15:34                   ` Alex Williamson
2009-05-22 15:36                     ` Chris Wright
2009-05-13  2:07               ` Yang, Sheng
2009-05-13 13:14                 ` Marcelo Tosatti
2009-05-13 11:43         ` Gleb Natapov
  -- strict thread matches above, loose matches on Subject: below --
2009-05-08 22:21 device-assignment deadlock Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.