mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: pavel@suse.cz
Cc: linux-kernel@vger.kernel.org, mporter@mvista.com, rmk@arm.linux.org.uk
Subject: Re: Patch: linux-2.5.30/arch/arm/mach-iop310/iq80310-pci.c BUG_ON(cond1 || cond2) separation
Date: Wed, 7 Aug 2002 22:53:01 -0700	[thread overview]
Message-ID: <200208080553.WAA09913@adam.yggdrasil.com> (raw)

Pavel Machek writes:
>it makes code slower/bigger... probably bad idea

	 The costs of expanding these two BUG_ON's is trivial,
considering that they get executed something like once per device,
during an initialization process.  This is a section of code where I
would think correctness and ease of debugging would be more important,
especially since they might be from bug reports submitted by users who
might have limited tolerance for repeatedly trying new kernels.

	If you're really squeezed for space, you're probably going to
have to define BUG() and BUG_ON() to something smaller that does not
generate a file name and line number (include/asm-i386/page.h an "#if"
for this, although mips does not), or even defining them as nothing.

	By the way, if no bug is detected, BUG_ON(cond1 || cond2)
executes the same instructions as BUG_ON(cond1); BUG_ON(cond2),
although there are probably greater instruction prefetch costs due to
the the ~20 bytes of code (that is normally not executed) for the
different call or trap instruction, and instruction cache issues.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

             reply	other threads:[~2002-08-08  5:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08  5:53 Adam J. Richter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-08-06  1:25 Adam J. Richter
2002-08-05 20:17 Adam J. Richter
2001-11-01 23:48 ` Pavel Machek
2002-08-07 22:06   ` Russell King
2002-08-05 22:02 ` Russell King

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=200208080553.WAA09913@adam.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@mvista.com \
    --cc=pavel@suse.cz \
    --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®