lkml.org 
[lkml]   [2006]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] lockdep: more unlock-on-error fixes
On Mon, Dec 18, 2006 at 03:39:36PM +0100, Ingo Molnar wrote:
>
> * Jarek Poplawski <jarkao2@o2.pl> wrote:
>
> > Hello,
> >
> > If any of this proposals should be omitted or separated let me know.
>
> thanks for the fixes, they look good to me. I have reorganized the
> __lock_acquire() changes a bit. Plus i dropped the check_locks_freed()
> changes: there's no reason lockdep should be using 'raw' irq flags
> saving - these functions are not part of the irq-flags tracing code so
> they dont /need/ to be raw.

I'm not 100% convinced - now trace_hardirqs_off/on is
done only for lockdep reasons, so it is like selfcheck.
But it's probably the matter of taste.

...
> Index: linux/kernel/lockdep.c
> ===================================================================
> --- linux.orig/kernel/lockdep.c
> +++ linux/kernel/lockdep.c
...
> @@ -2210,19 +2214,24 @@ out_calc_hash:
> if (!chain_head && ret != 2)
> if (!check_prevs_add(curr, hlock))
> return 0;
> - graph_unlock();
> - }
> + } else
> + /* after lookup_chain_cache(): */
> + if (unlikely(!debug_locks))
> + return 0;
> +
> curr->lockdep_depth++;
> check_chain_key(curr);
> if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) {
> - debug_locks_off();
> + debug_locks_off_graph_unlock();
> printk("BUG: MAX_LOCK_DEPTH too low!\n");
> printk("turning off the locking correctness validator.\n");
> return 0;
> }
> +
> if (unlikely(curr->lockdep_depth > max_lockdep_depth))
> max_lockdep_depth = curr->lockdep_depth;
>
> + graph_unlock();
> return 1;
> }

Sorry but it's not good... There could be no lock
at all here (eg. trylock != 0 || check != 2).

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

\
 
 \ /
  Last update: 2006-12-19 08:23    [W:0.048 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site