mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Russell King <rmk@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.32-bug
Date: Sat, 31 Aug 2002 14:00:08 +0200	[thread overview]
Message-ID: <20020831140007.C781@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <E17ktU0-00035E-00@flint.arm.linux.org.uk>; from rmk@arm.linux.org.uk on Fri, Aug 30, 2002 at 10:39:12PM +0100

Hi Rusty,

On Fri, Aug 30, 2002 at 10:39:12PM +0100, Russell King wrote:
> This patch appears not to be in 2.5.32, but applies cleanly.
> 
> This patch moves BUG() and PAGE_BUG() from asm/page.h into asm/bug.h.
> 
> We also fix up linux/dcache.h, which included asm/page.h for the sole
> purpose of getting the BUG() definition.
> 
> Since linux/kernel.h makes use of BUG(), asm/bug.h is included there
> as well.
> --- orig/include/asm-cris/bug.h	Thu Jan  1 01:00:00 1970
> +++ linux/include/asm-cris/bug.h	Sun Jan  6 11:46:09 2002
> @@ -0,0 +1,12 @@
> +#ifndef _CRIS_BUG_H
> +#define _CRIS_BUG_H
> +
> +#define BUG() do { \
> +  printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
> +} while (0)
> +
> +#define PAGE_BUG(page) do { \
> +         BUG(); \
> +} while (0)
> +
> +#endif

These kind of implementation of BUG() is not very useful. Callers
of BUG() and BUG_ON() assume, that the thread is aborted and do
nothing to fixup after BUG(). 

That makes sense, because that way BUG reduces code size and
simplifies actual code by omitting the error handling for errors
which are in the in kernel caller.

So please consider using panic() instead of printk() here to
encourage fixing of BUGs.

Maybe we should even officially define, whether BUG() is an
execution barrier or not. 

I would vote for YES, because of code size reductions under this
assumption.


Thanks & Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth

  reply	other threads:[~2002-08-31 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-30 21:39 Russell King
2002-08-31 12:00 ` Ingo Oeser [this message]
2002-08-31 17:14   ` Russell King
2002-09-02  6:51     ` Rusty Russell

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=20020831140007.C781@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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

all inboxes | Powered by JetHome®