From: Ingo Molnar <mingo@kernel.org>
To: Dave Jones <davej@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Print out additional debugging advice when we hit lockdep BUGs
Date: Fri, 26 Apr 2013 08:32:17 +0200 [thread overview]
Message-ID: <20130426063217.GE25912@gmail.com> (raw)
In-Reply-To: <20130425174002.GA26769@redhat.com>
* Dave Jones <davej@redhat.com> wrote:
> On Wed, Apr 24, 2013 at 08:48:13AM +0200, Ingo Molnar wrote:
>
> > These patterns repeated in 4 places really call for a common helper
> > defined as print_lockdep_off(fmt...) or so?
> >
> > (Can be a followup patch if that's easier for you.)
>
> Given there was only one case which was really different, I opted not to
> bother with varargs, and just pass the one string that changes and add
> an extra printk for that special case (MAX_LOCK_DEPTH)
>
> --
>
> Consolidate the lockdep "too low" messages into one function.
> Also add some missing printk levels.
>
> Signed-off-by: Dave Jones <davej@redhat.com>
>
> diff --git a/kernel/lockdep.c b/kernel/lockdep.c
> index e4c001f..be52e6d 100644
> --- a/kernel/lockdep.c
> +++ b/kernel/lockdep.c
> @@ -380,6 +380,13 @@ static int verbose(struct lock_class *class)
> unsigned long nr_stack_trace_entries;
> static unsigned long stack_trace[MAX_STACK_TRACE_ENTRIES];
>
> +static void print_lockdep_off(const char *which)
> +{
> + printk(KERN_DEBUG "BUG: %s too low!\n", which);
> + printk(KERN_DEBUG "turning off the locking correctness validator.\n");
> + printk(KERN_DEBUG "Attach output of /proc/lock_stat to bug report\n");
> +}
> +
Yeah, that looks perfectly fine - thanks!
( I tweaked it a tiny bit to pass in a generic bug-string instead of
assuming that the warning is necessarily about some 'too low' value.
This makes actual usage sites of print_lockdep_off() easier to read and
closer to existing WARN() patterns. )
Thanks,
Ingo
next prev parent reply other threads:[~2013-04-26 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 16:34 Print out additional debugging advice when we hit lockdep BUGs Dave Jones
2013-04-24 6:48 ` Ingo Molnar
2013-04-25 17:40 ` Dave Jones
2013-04-26 6:32 ` Ingo Molnar [this message]
2013-04-26 14:19 ` [tip:core/locking] lockdep: Consolidate bug messages into a single print_lockdep_off() function tip-bot for Dave Jones
2013-04-26 14:18 ` [tip:core/locking] lockdep: Print out additional debugging advice when we hit lockdep BUGs tip-bot for Dave Jones
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=20130426063217.GE25912@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.