Re: [patch] lock debugging: fix DEBUG_LOCKS_WARN_ON() & debug_locks_silent

From: Ingo Molnar
Date: Tue Dec 19 2006 - 04:47:03 EST



* Matthew Wilcox <matthew@xxxxxx> wrote:

> On Tue, Dec 19, 2006 at 10:31:35AM +0100, Ingo Molnar wrote:
> >
> > * Jarek Poplawski <jarkao2@xxxxx> wrote:
> >
> > > > if (unlikely(c)) { \
> > > > - if (debug_locks_silent || debug_locks_off()) \
> > > > + if (!debug_locks_silent && debug_locks_off()) \
> >
> > btw., updated patch is below - the right order is to first do
> > debug_locks_off(), then debug_locks_silent.
>
> Then how does one re-enable lock debugging after running the locking
> testsuite?

see the lib/locking-selftest.c:locking_selftest() function, if all
testcases pass then it re-enables lock debugging. If a testcase turns
off lock debugging because it triggers a bug (as many of them
legitimately do), then reset_locks()->lockdep_reset() will set
debug_locks back to 1.

Ingo
-
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/