[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/3] xen/evtchn: avoid a deadlock when unbinding an event channel



On Fri, Jul 19, 2013 at 03:51:58PM +0100, David Vrabel wrote:
> From: David Vrabel <david.vrabel@xxxxxxxxxx>
> 
> Unbinding an event channel (either with the ioctl or when the evtchn
> device is closed) may deadlock because disable_irq() is called with
> port_user_lock held which is also locked by the interrupt handler.

So what you are saying is that if the ioctl IOCTL_EVTCHN_UNBIND
is called (and takes an spinlock) and the evtchn_interrupt triggers
it would deadlock?

But isn't this the IRQ variant of spinlock? Which disables interrupts?
Could you perhaps write this out a bit with CPU1 and CPU2 in seperate
columns? I think I must missing something.

Thanks!
> 
> Using get_port_user() to check if a port's user is safe without the
> spin lock (as it's protected by u->bind_mutex in the ioctl) so just
> remove the unnesssary locking.

What about in the interrupt handler? It does not use the mutex?
How will it protect the get_port_user() from being stale?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.