From: Dario Faggioli <dario.faggioli@citrix.com>
To: Quan Xu <quan.xu@intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
Jan Beulich <JBeulich@suse.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization.
Date: Wed, 9 Mar 2016 15:45:00 +0100 [thread overview]
Message-ID: <1457534700.3102.387.camel@citrix.com> (raw)
In-Reply-To: <56E0397702000078000DADA4@prv-mh.provo.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1439 bytes --]
On Wed, 2016-03-09 at 06:55 -0700, Jan Beulich wrote:
> >
> > > > On 09.03.16 at 14:46, <quan.xu@intel.com> wrote:
> > Now I am still not clear for this point- "this inconsistency might
> > lead to
> > deadlock".
> > I think it is similar to 'mixing interrupt disabled and enabled
> > spinlocks is
> > something we disallow'.
> > I hope you can give me an example about how to lead to deadlock.
> The implication from disabling interrupts while acquiring a lock
> is that the lock is also being acquired by some interrupt
> handler. If you mix acquire types, the one not disabling
> interrupts is prone to be interrupted, and the interrupt trying
> to get hold of the lock the same CPU already owns.
>
Exactly.
There are a few other nice writeup online as well.
The most famous one, I guess, is this one from Linus (look at "Lesson
3: spinlocks revisited.")
https://www.kernel.org/doc/Documentation/locking/spinlocks.txt
And, of course, there's the comment inside check_lock(), in
xen/common/spinlock.c, in Xen's codebase, where another example of how
it could be dangerous to mix, even if multiple cpus are involved.
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-09 14:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 3:08 [PATCH v2 0/2] Make the pcidevs_lock a recursive one Quan Xu
2016-03-09 3:08 ` [PATCH v2 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization Quan Xu
2016-03-09 5:19 ` Tian, Kevin
2016-03-09 7:31 ` Xu, Quan
2016-03-09 10:09 ` Jan Beulich
2016-03-09 10:24 ` Dario Faggioli
2016-03-09 12:52 ` Xu, Quan
2016-03-09 13:19 ` Dario Faggioli
2016-03-09 13:46 ` Xu, Quan
2016-03-09 13:55 ` Jan Beulich
2016-03-09 14:45 ` Dario Faggioli [this message]
2016-03-10 5:36 ` Xu, Quan
2016-03-10 3:21 ` Xu, Quan
2016-03-09 3:08 ` [PATCH v2 2/2] IOMMU/spinlock: Make the pcidevs_lock a recursive one Quan Xu
2016-03-09 5:21 ` Tian, Kevin
2016-03-09 5:50 ` Xu, Quan
2016-03-09 12:18 [PATCH v2 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization Xu, Quan
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=1457534700.3102.387.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=JBeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=quan.xu@intel.com \
--cc=suravee.suthikulpanit@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).