From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 1/3] xen/evtchn: avoid a deadlock when unbinding an event channel
Date: Mon, 29 Jul 2013 10:07:27 -0400 [thread overview]
Message-ID: <20130729140727.GA5848@phenom.dumpdata.com> (raw)
In-Reply-To: <1374245520-19270-2-git-send-email-david.vrabel@citrix.com>
On Fri, Jul 19, 2013 at 03:51:58PM +0100, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
>
> 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?
next prev parent reply other threads:[~2013-07-29 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 14:51 [PATCH 0/3] xen: evtchn and gntdev device fixes and perf improvements David Vrabel
2013-07-19 14:51 ` [PATCH 1/3] xen/evtchn: avoid a deadlock when unbinding an event channel David Vrabel
2013-07-29 14:07 ` Konrad Rzeszutek Wilk [this message]
2013-07-29 15:35 ` David Vrabel
2013-07-19 14:51 ` [PATCH 2/3] xen/p2m: avoid unneccesary TLB flush in m2p_remove_override() David Vrabel
2013-07-21 14:12 ` Stefano Stabellini
2013-07-19 14:52 ` [PATCH 3/3] xen/evtchn: improve scalability by using per-user locks David Vrabel
2013-07-19 14:57 ` [PATCH 0/3] xen: evtchn and gntdev device fixes and perf improvements David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130729140727.GA5848@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.