Re: [PATCH] 2.3.40: <linux/linkage.h> generates incorrect cache alignments

From: almesber@lrc.di.epfl.ch
Date: Thu Jan 27 2000 - 21:58:55 EST


Chris Sears wrote:
> I'm not exactly sure why "bad magic ..." desperately needs to be aligned.

gcc probably saw the "bad magic" and acted accordingly ;-)

Looking at your ioport.s, I kind of wondered how much space we're wasting
in the kernel for constant strings of this type ...

$ strings vmlinux | sort | uniq -c | sort -rn

342 wq bug, forcing oops.
342 kernel BUG at %s:%d!
342 eip: %p
342 bad magic %lx (should be %lx, creator %lx),
342 bad magic %lx (should be %lx),
342 /var/tmp/wa/2340/work/include/asm/spinlock.h
341 /var/tmp/wa/2340/work/include/asm/semaphore.h
336 /var/tmp/wa/2340/work/include/linux/sched.h
323 /var/tmp/wa/2340/work/include/linux/mm.h

(342-1)*(22+21+8+44+32+45) = 58652
(341-1)*46+(336-1)*44+(323-1)*41 = 43582

$ size vmlinux
   text data bss dec hex filename
2065812 322818 521856 2910486 2c6916 vmlinux

$ bc -l
(58652+43582)/(2065812+322818+521856)
.03512609234334059672

3.5%, not bad. And there are a few more that "only" occur 100 times or
so, plus an army of strings that occur twice. Using the following a
bit too primitive filter, I get

... | awk '{ c = $1; $1 = ""; l = length($0)-1; if (l > 8) s += (c-1)*l; } \
  END { print s; }'
128973

$ bc -l
128973/(2065812+322818+521856)
.04431321779249238786

So 3-5% may be a realistic goal, depending on how long the paths are,
how aggressive we are, and whether we can also catch the zillions of "%d",
"\n", "." or such that must be out there.

I guess this should give the "let's throw five man-years at sequeezing
0.03871% worth of extra performance out of the kernel" folks some
incentive ;-))

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:20 EST