Re: possible slab deadlock while doing ifenslave

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

 



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@xxxxxxxxx>
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@xxxxxxxxxx
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-gadqbdfxorhia1w5ewmoiodd@xxxxxxxxxxxxxx
---
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@xxxxxxxxx.  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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]