From: Peter Zijlstra <peterz@infradead.org>
To: David Rientjes <rientjes@google.com>
Cc: Hans Schillstrom <hans@schillstrom.com>,
Christoph Lameter <cl@gentwo.org>, Ingo Molnar <mingo@redhat.com>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Matt Mackall <mpm@selenic.com>,
Sitsofe Wheeler <sitsofe@yahoo.com>,
linux-mm@kvack.org
Subject: Re: possible slab deadlock while doing ifenslave
Date: Mon, 28 Nov 2011 22:19:18 +0100 [thread overview]
Message-ID: <1322515158.2921.179.camel@twins> (raw)
In-Reply-To: alpine.DEB.2.00.1110131557090.10968@chino.kir.corp.google.com
On Fri, 2011-10-14 at 01:21 +0200, Peter Zijlstra wrote:
> On Thu, 2011-10-13 at 16:03 -0700, David Rientjes wrote:
>
> > Ok, I think this may be related to what Sitsofe reported in the "lockdep
> > recursive locking detected" thread on LKML (see
> > http://marc.info/?l=linux-kernel&m=131805699106560).
> >
> > Peter and Christoph hypothesized that 056c62418cc6 ("slab: fix lockdep
> > warnings") may not have had full coverage when setting lockdep classes for
> > kmem_list3 locks that may be called inside of each other because of
> > off-slab metadata.
> >
> > I think it's safe to say there is no deadlock possibility here or we would
> > have seen it since 2006 and this is just a matter of lockdep annotation
> > that needs to be done. So don't worry too much about the warning even
> > though I know it's annoying and it suppresses future lockdep output (even
> > more annoying!).
> >
> > I'm not sure if there's a patch to address that yet, I think one was in
> > the works. If not, I'll take a look at rewriting that lockdep annotation.
>
> Urgh, I so totally forgot about that.. :-/ So no, no patch yet.
---
Subject: slab, lockdep: Fix silly bug
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Mon Nov 28 21:12:40 CET 2011
Commit 30765b92 ("slab, lockdep: Annotate the locks before using
them") moves the init_lock_keys() call from after g_cpucache_up =
FULL, to before it. And overlooks the fact that init_node_lock_keys()
tests for it and ignores everything !FULL.
Introduce a LATE stage and change the lockdep test to be <LATE.
Cc: stable@kernel.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-gadqbdfxorhia1w5ewmoiodd@git.kernel.org
---
Index: linux-2.6/mm/slab.c
===================================================================
--- linux-2.6.orig/mm/slab.c
+++ linux-2.6/mm/slab.c
@@ -595,6 +595,7 @@ static enum {
PARTIAL_AC,
PARTIAL_L3,
EARLY,
+ LATE,
FULL
} g_cpucache_up;
@@ -671,7 +672,7 @@ static void init_node_lock_keys(int q)
{
struct cache_sizes *s = malloc_sizes;
- if (g_cpucache_up != FULL)
+ if (g_cpucache_up < LATE)
return;
for (s = malloc_sizes; s->cs_size != ULONG_MAX; s++) {
@@ -1666,6 +1667,8 @@ void __init kmem_cache_init_late(void)
{
struct kmem_cache *cachep;
+ g_cpucache_up = LATE;
+
/* Annotate slab for lockdep -- annotate the malloc caches */
init_lock_keys();
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-11-28 21:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 8:19 possible slab deadlock while doing ifenslave Hans Schillstrom
2011-10-12 20:35 ` David Rientjes
2011-10-13 8:19 ` Hans Schillstrom
2011-10-13 23:03 ` David Rientjes
2011-10-13 23:21 ` Peter Zijlstra
2011-10-14 6:30 ` Hans Schillstrom
2011-11-28 21:19 ` Peter Zijlstra [this message]
2011-11-28 21:20 ` Peter Zijlstra
2011-11-29 14:58 ` Christoph Lameter
2011-11-29 15:38 ` Peter Zijlstra
2011-11-29 14:55 ` Christoph Lameter
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=1322515158.2921.179.camel@twins \
--to=peterz@infradead.org \
--cc=cl@gentwo.org \
--cc=hans@schillstrom.com \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
--cc=rientjes@google.com \
--cc=sitsofe@yahoo.com \
/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.