Re: Linux 3.1-rc9

From: Steven Rostedt
Date: Wed Nov 02 2011 - 19:00:18 EST


On Wed, Nov 02, 2011 at 06:10:23PM -0400, Steven Rostedt wrote:
> Thomas pointed me here.
>
> On Mon, Oct 31, 2011 at 10:32:46AM -0700, Simon Kirby wrote:
> > [104661.244767]
> > [104661.244767] Possible unsafe locking scenario:
> > [104661.244767]
> > [104661.244767] CPU0 CPU1
> > [104661.244767] ---- ----
> > [104661.244767] lock(slock-AF_INET);
> > [104661.244767] lock(slock-AF_INET);
> > [104661.244767] lock(slock-AF_INET);
> > [104661.244767] lock(slock-AF_INET);
> > [104661.244767]
> > [104661.244767] *** DEADLOCK ***
> > [104661.244767]
>
> Bah, I used the __print_lock_name() function to show the lock names in
> the above, which leaves off the subclass number. I'll go write up a
> patch that fixes that.
>

Simon,

If you are still triggering the bug. Could you do me a favor and apply
the following patch. Just to make sure it fixes the confusing output
from above.

Thanks,

-- Steve


diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 91d67ce..d821ac9 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -490,16 +490,22 @@ void get_usage_chars(struct lock_class *class, char usage[LOCK_USAGE_CHARS])
usage[i] = '\0';
}

-static int __print_lock_name(struct lock_class *class)
+static void __print_lock_name(struct lock_class *class)
{
char str[KSYM_NAME_LEN];
const char *name;

name = class->name;
- if (!name)
+ if (!name) {
name = __get_key_name(class->key, str);
-
- return printk("%s", name);
+ printk("%s", name);
+ } else {
+ printk("%s", name);
+ if (class->name_version > 1)
+ printk("#%d", class->name_version);
+ if (class->subclass)
+ printk("/%d", class->subclass);
+ }
}

static void print_lock_name(struct lock_class *class)
@@ -509,17 +515,8 @@ static void print_lock_name(struct lock_class *class)

get_usage_chars(class, usage);

- name = class->name;
- if (!name) {
- name = __get_key_name(class->key, str);
- printk(" (%s", name);
- } else {
- printk(" (%s", name);
- if (class->name_version > 1)
- printk("#%d", class->name_version);
- if (class->subclass)
- printk("/%d", class->subclass);
- }
+ printk(" (");
+ __print_lock_name(class);
printk("){%s}", usage);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/