Re: [patch] lockdep: fix possible races while disabling lock-debugging

From: Jarek Poplawski
Date: Fri Dec 08 2006 - 01:20:46 EST


On Thu, Dec 07, 2006 at 02:29:03PM +0100, Ingo Molnar wrote:
> Subject: [patch] lockdep: fix possible races while disabling lock-debugging
> From: Ingo Molnar <mingo@xxxxxxx>
...
> (also note that as we all know the Linux kernel is, by definition,
> bug-free and perfect, so this code never triggers, so these fixes are
> highly theoretical. I wrote this patch for aesthetic reasons alone.)

Now it's too sexy! I can't work.

PS: I had some problems with patching - probably
because of something from -mm, but:

> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
...
> @@ -567,12 +601,10 @@ static noinline int print_circular_bug_t
> if (debug_locks_silent)
> return 0;
>
> - /* hash_lock unlocked by the header */
> - __raw_spin_lock(&hash_lock);
> this.class = check_source->class;
> if (!save_trace(&this.trace))
> return 0;
> - __raw_spin_unlock(&hash_lock);
> +

IMHO lock is needed here for save_trace.

...
> @@ -1212,7 +1244,8 @@ register_lock_class(struct lockdep_map *
> hash_head = classhashentry(key);
>
> raw_local_irq_save(flags);
> - __raw_spin_lock(&hash_lock);
> + if (!graph_lock())

! raw_local_irq_restore(flags);

> + return NULL;
> /*
> * We have to do the hash-walk again, to avoid races
> * with another CPU:

Jarek P.
-
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/