From: Andi Kleen <andi@firstfloor.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: randy.dunlap@oracle.com, lenb@kernel.org,
linux-acpi@vger.kernel.org, linux-next@vger.kernel.org
Subject: Re: [PATCH -next] acpi utmisc: use WARN_ON() instead of warn_on_slowpath()
Date: Wed, 02 Jul 2008 22:51:52 +0200 [thread overview]
Message-ID: <486BEA68.7000801@firstfloor.org> (raw)
In-Reply-To: <20080702133540.20d578cd.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Wed, 02 Jul 2008 22:11:06 +0200
> Andi Kleen <andi@firstfloor.org> wrote:
>
>> Here's a patch. Can you use that one instead of Randy's please?
>>
>
> No.
>
>> [bug-fallback text/plain (593B)]
>> Supply warn_on_slow_path() even for the !CONFIG_BUG case
>>
>> Fix build problem with ACPI for !CONFIG_BUG. Noted by Randy Dunlap.
>>
>> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>>
>> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
>> index 2632328..d0d83b7 100644
>> --- a/include/asm-generic/bug.h
>> +++ b/include/asm-generic/bug.h
>> @@ -63,6 +63,9 @@ extern void warn_on_slowpath(const char *file, const int line);
>> unlikely(__ret_warn_on); \
>> })
>> #endif
>> +
>> +static inline void warn_on_slowpath(const char *file, const int line) {}
>> +
>> #endif
>
> There's no reason why asm/bug.h has to even include asm-generic/bug.h.
I checked them all and they all do.
Besides for the ACPI case we only have to care about x86 and ia64.
But all do it anyways.
> And there's no reason why an architecture which defined __WARN needs to
> define warn_on_slowpath() even if it _does_ include asm-generic/bug.h.
> And I didn't even begin to look at what might disable
> WANT_WARN_ON_SLOWPATH.
I think warn_on_slow_path() should be a general interface.
Perhaps with a better name though.
>
> This is all poking deep into the private internals of one particular
> implementation of this interface.
But it's in kernel/panic.c. I don't think anyone can compile
without that. So it should be always there (unless you undefine CONFIG_BUG)
> Furthermore even if it _does_ happen to work, you've gone and coupled
> the availability of this acpi debbugging feature to CONFIG_BUG, which
> seems arbitrary.
Well not defining CONFIG_BUG means "I don't care about debugging" doesn't it?
Not having (or having only crippled) ACPI debugging in that case seems reasonable
Doesn't seem that arbitrary to me.
>
> If you really want to do it this way (and it sounds reasonable) then
> can we please do it in a less-than-totally-hacky-and-broken way?
>
>
>
> For example, define a new, always-available helper function in (say)
> kernel/panic.c along the lines of
>
> void emit_warning_message(?)(const char *msg, int line)
Ok we can just rename warn_on_slow_path() which is already there to that new name.
Would that satisfy you?
>
> and then call that from warn_on_slowpath(). Will require that
> warn_on_slowpath become inlined so we don't get a useless extra entry
> in the backtraces all the time.
>
> Or just use printk and dump_stack.
I think the reason for the warn_on_slowpath() is that it produces
patterns that can be detected by Arjan's kerneloops scripts.
I'm not sure manual printk/dump_stack would have the same effect.
-Andi
next prev parent reply other threads:[~2008-07-02 20:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 17:33 [PATCH -next] bug.h: add empty warn_on_slowpath() for CONFIG_BUG=n Randy Dunlap
2008-07-01 20:17 ` Andrew Morton
2008-07-01 20:23 ` Randy Dunlap
2008-07-01 20:35 ` Andrew Morton
2008-07-02 18:28 ` [PATCH -next] acpi utmisc: use WARN_ON() instead of warn_on_slowpath() Randy Dunlap
2008-07-02 18:50 ` Andi Kleen
2008-07-02 19:14 ` Andrew Morton
2008-07-02 19:31 ` Andi Kleen
2008-07-02 19:43 ` Andrew Morton
2008-07-02 20:11 ` Andi Kleen
2008-07-02 20:35 ` Andrew Morton
2008-07-02 20:51 ` Andi Kleen [this message]
2008-07-02 21:02 ` Andrew Morton
2008-07-02 21:07 ` Andi Kleen
2008-07-02 21:14 ` Andrew Morton
2008-07-06 17:18 ` Len Brown
2008-07-06 18:13 ` Andi Kleen
2008-07-06 18:52 ` Arjan van de Ven
2008-07-07 6:19 ` Andi Kleen
2008-07-07 7:03 ` Arjan van de Ven
2008-07-08 15:44 ` Thomas Renninger
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=486BEA68.7000801@firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
/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.