From: Jarek Poplawski <jarkao2@o2.pl>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Linus Torvalds <torvalds@osdl.org>
Subject: Re: [patch] lockdep: more unlock-on-error fixes
Date: Tue, 19 Dec 2006 08:21:34 +0100 [thread overview]
Message-ID: <20061219072134.GA1731@ff.dom.local> (raw)
In-Reply-To: <20061218143936.GA4415@elte.hu>
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.
next prev parent reply other threads:[~2006-12-19 7:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-18 11:56 [PATCH] lockdep: returns after DEBUG_LOCKS_WARN_ONs etc Jarek Poplawski
2006-12-18 14:39 ` [patch] lockdep: more unlock-on-error fixes Ingo Molnar
2006-12-19 7:21 ` Jarek Poplawski [this message]
2006-12-19 9:50 ` [patch] lockdep: more unlock-on-error fixes, fix Ingo Molnar
2006-12-19 13:22 ` Jarek Poplawski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061219072134.GA1731@ff.dom.local \
--to=jarkao2@o2.pl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox