public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* BUGed to death
@ 2003-04-14 20:19 Martin J. Bligh
  2003-04-14 20:40 ` Duncan Sands
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Martin J. Bligh @ 2003-04-14 20:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Seems all these bug checks are fairly expensive. I can get 1%
back on system time for kernel compiles by changing BUG to 
"do {} while (0)" to make them all compile away. Profiles aren't
very revealing though ... seems to be within experimental error ;-(

I was pondering CONFIG_RUN_WILD_NAKED_AND_FREE, but maybe we can
just nail a few of the hottest path ones instead (I think you did
a couple already recently). I guess that suggestion isn't much
use without more profile data though ;-)

M.

Kernbench: (make -j N vmlinux, where N = 2 x num_cpus)
                              Elapsed      System        User         CPU
              2.5.67-mjb2       43.34       76.24      563.55     1476.25
        2.5.67-mjb2-nobug       43.43       75.29      564.12     1471.75

Kernbench: (make -j N vmlinux, where N = 16 x num_cpus)
                              Elapsed      System        User         CPU
              2.5.67-mjb2       43.91       85.05      570.61     1493.50
        2.5.67-mjb2-nobug       44.12       84.80      571.10     1485.00

Kernbench: (make -j vmlinux, maximal tasks)
                              Elapsed      System        User         CPU
              2.5.67-mjb2       44.01       85.12      570.10     1488.25
        2.5.67-mjb2-nobug       44.03       83.93      570.37     1485.25


DISCLAIMER: SPEC(tm) and the benchmark name SDET(tm) are registered
trademarks of the Standard Performance Evaluation Corporation. This 
benchmarking was performed for research purposes only, and the run results
are non-compliant and not-comparable with any published results.

Results are shown as percentages of the first set displayed

SDET 1  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         1.9%
        2.5.67-mjb2-nobug       104.1%         0.0%

SDET 2  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         1.9%
        2.5.67-mjb2-nobug       106.4%         0.0%

SDET 4  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         3.8%
        2.5.67-mjb2-nobug        97.1%         1.3%

SDET 8  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         0.9%
        2.5.67-mjb2-nobug       100.7%         0.7%

SDET 16  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         1.3%
        2.5.67-mjb2-nobug       102.8%         0.7%

SDET 32  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         0.5%
        2.5.67-mjb2-nobug       100.8%         0.5%

SDET 64  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         0.4%
        2.5.67-mjb2-nobug       100.6%         0.3%

SDET 128  (see disclaimer)
                           Throughput    Std. Dev
              2.5.67-mjb2       100.0%         0.1%
        2.5.67-mjb2-nobug       100.9%         0.2%


RMAPBENCH

rmapbench: 100x100-linear
                              Elapsed      System        User         CPU
              2.5.67-mjb2       44.24      470.00      211.26     1527.67
        2.5.67-mjb2-nobug       51.20      579.11      218.33     1533.33

rmapbench: 100x100-random
                              Elapsed      System        User         CPU
              2.5.67-mjb2        2.99       26.50        0.44      895.67
        2.5.67-mjb2-nobug        3.03       28.02        0.33      892.00

rmapbench: 1x10000-linear
                              Elapsed      System        User         CPU
              2.5.67-mjb2        2.53        1.32        0.19       59.67
        2.5.67-mjb2-nobug        2.37        1.17        0.19       57.00


^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: BUGed to death
@ 2003-04-15 14:30 rwhron
  2003-04-15 15:57 ` Dave Jones
  0 siblings, 1 reply; 35+ messages in thread
From: rwhron @ 2003-04-15 14:30 UTC (permalink / raw)
  To: linux-kernel, reiserfs-list

The patch below eliminates 4 BUG() calls that clearly 
cannot happen based on the context.

--- linux-2.5.67-mm2/fs/reiserfs/hashes.c.orig	2003-04-15 10:11:44.000000000 -0400
+++ linux-2.5.67-mm2/fs/reiserfs/hashes.c	2003-04-15 10:13:43.000000000 -0400
@@ -90,10 +90,6 @@
 
 	if (len >= 12)
 	{
-	    	//assert(len < 16);
-		if (len >= 16)
-		    BUG();
-
 		a = (u32)msg[ 0]      |
 		    (u32)msg[ 1] << 8 |
 		    (u32)msg[ 2] << 16|
@@ -116,9 +112,6 @@
 	}
 	else if (len >= 8)
 	{
-	    	//assert(len < 12);
-		if (len >= 12)
-		    BUG();
 		a = (u32)msg[ 0]      |
 		    (u32)msg[ 1] << 8 |
 		    (u32)msg[ 2] << 16|
@@ -137,9 +130,6 @@
 	}
 	else if (len >= 4)
 	{
-	    	//assert(len < 8);
-		if (len >= 8)
-		    BUG();
 		a = (u32)msg[ 0]      |
 		    (u32)msg[ 1] << 8 |
 		    (u32)msg[ 2] << 16|
@@ -154,9 +144,6 @@
 	}
 	else
 	{
-	    	//assert(len < 4);
-		if (len >= 4)
-		    BUG();
 		a = b = c = d = pad;
 		for(i = 0; i < len; i++)
 		{
-- 
Randy Hron
http://home.earthlink.net/~rwhron/kernel/bigbox.html


^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: BUGed to death
@ 2003-04-15 18:33 Chuck Ebbert
  0 siblings, 0 replies; 35+ messages in thread
From: Chuck Ebbert @ 2003-04-15 18:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel


> If you do that, you must audit every single BUG_ON to make sure the
> expression doesn't have any side effects.
>
>	BUG_ON(do_the_good_stuff());


  Sounds like a candidate for machine audit.  You can declare
pure functions in GCC 2.96+ but I see no way to assert that an
expression is pure...



--
 Chuck

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2003-04-23 14:56 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 20:19 BUGed to death Martin J. Bligh
2003-04-14 20:40 ` Duncan Sands
2003-04-14 21:02   ` Dave Jones
2003-04-14 21:10     ` Duncan Sands
2003-04-14 21:17       ` Dave Jones
2003-04-15 11:57         ` Duncan Sands
2003-04-15 12:05           ` Dave Jones
2003-04-15 14:39             ` Martin J. Bligh
2003-04-23 15:08             ` Duncan Sands
2003-04-14 21:00 ` Dave Jones
2003-04-14 20:55   ` Martin J. Bligh
2003-04-14 21:08     ` Dave Jones
2003-04-14 21:50       ` Andrew Morton
2003-04-14 21:55         ` Dave Jones
2003-04-15  0:23   ` H. Peter Anvin
2003-04-15 12:01 ` Duncan Sands
2003-04-15 12:31   ` Jens Axboe
2003-04-15 12:36     ` Dave Jones
2003-04-15 12:40       ` Jens Axboe
2003-04-15 12:49     ` Sean Neakums
2003-04-15 12:52       ` Sean Neakums
2003-04-15 13:01     ` Roman Zippel
2003-04-15 13:17       ` Jens Axboe
2003-04-15 13:55     ` Duncan Sands
2003-04-15 14:22       ` Jens Axboe
2003-04-15 14:35   ` Martin J. Bligh
2003-04-15 14:39     ` Duncan Sands
2003-04-15 14:45       ` Martin J. Bligh
2003-04-15 14:58         ` Duncan Sands
  -- strict thread matches above, loose matches on Subject: below --
2003-04-15 14:30 rwhron
2003-04-15 15:57 ` Dave Jones
2003-04-15 16:11   ` Nick Piggin
2003-04-15 16:42   ` Michael Buesch
2003-04-15 16:45     ` Dave Jones
2003-04-15 18:33 Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox