From: Joerg Roedel <joerg.roedel@amd.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Roland Dreier <roland@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dma-debug: Fix deadlock with netconsole or other drivers that use the DMA API
Date: Fri, 20 Apr 2012 13:22:06 +0200 [thread overview]
Message-ID: <20120420112206.GB12667@amd.com> (raw)
In-Reply-To: <20120419114811.9e77accb.akpm@linux-foundation.org>
On Thu, Apr 19, 2012 at 11:48:11AM -0700, Andrew Morton wrote:
> On Thu, 19 Apr 2012 11:12:53 -0700
> Roland Dreier <roland@kernel.org> wrote:
> > ---
> > lib/dma-debug.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/dma-debug.c b/lib/dma-debug.c
> > index 13ef233..f198b4e 100644
> > --- a/lib/dma-debug.c
> > +++ b/lib/dma-debug.c
> > @@ -436,8 +436,8 @@ static struct dma_debug_entry *dma_entry_alloc(void)
> > spin_lock_irqsave(&free_entries_lock, flags);
> >
> > if (list_empty(&free_entries)) {
> > - pr_err("DMA-API: debugging out of memory - disabling\n");
> > global_disable = true;
> > + pr_err("DMA-API: debugging out of memory - disabling\n");
> > goto out;
> > }
>
> So *any* printk can deadlock if free_entries_lock is held and
> global_disable==false?
>
> In that case we're going to need much sterner fixes. Any list_head
> operation can do a printk if list_head debugging is enabled.
> dma_debug_resize_entries() does a kfree() under free_entries_lock(!).
>
> Methinks we need a more general fix?
Hmm, I think the best way to fix it is to switch the hash-bucket lists
to rcu. Then the lock is only needed in hash_bucket_add/del and we
should be fine.
But that is probably only a fix for the next merge window.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
prev parent reply other threads:[~2012-04-20 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-19 18:12 [PATCH] dma-debug: Fix deadlock with netconsole or other drivers that use the DMA API Roland Dreier
2012-04-19 18:48 ` Andrew Morton
2012-04-19 23:36 ` Roland Dreier
2012-04-19 23:50 ` Andrew Morton
2012-04-20 11:22 ` Joerg Roedel [this message]
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=20120420112206.GB12667@amd.com \
--to=joerg.roedel@amd.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@kernel.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