Re: ext3 performance inconsistencies, 2.4/2.6

From: Linus Torvalds
Date: Tue Nov 04 2003 - 17:33:10 EST

On Tue, 4 Nov 2003, Ulrich Drepper wrote:
> I don't see any verison numbers mentioned. If you want to benchmark
> NPTL use the recent code, e.g., from Fedora Core 1 or RHEL3. Nothing
> else makes any sense since there have mean countless changes since the
> early releases.

This is actually _really_ trivial to see with a simple test program.

This is Fedora Core test3:

#include <stdlib.h>

/* Change this to match your CPU */
#define NR (10*1000*1000)

int main(int argc, char **argv)
int i;
for (i = 0; i < NR; i++)

and then just time it.

I get:

torvalds@home:~> time ./a.out > /dev/null

real 0m1.305s
user 0m1.283s
sys 0m0.004s


torvalds@home:~> time LD_ASSUME_KERNEL=2.4.1 ./a.out > /dev/null

real 0m0.321s
user 0m0.318s
sys 0m0.003s

ie a factor of _four_ difference in the speed of "putchar()".

Interestingly, if I compile the program statically, I don't see this
effect, and it's noticeably faster still:

torvalds@home:~> gcc -O2 -static test.c
torvalds@home:~> time ./a.out > /dev/null

real 0m0.193s
user 0m0.191s
sys 0m0.002s

torvalds@home:~> time LD_ASSUME_KERNEL=2.4.1 ./a.out > /dev/null

real 0m0.194s
user 0m0.190s
sys 0m0.004s

Is the TLS stuff done through an extra dynamically loaded indirection or


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at