Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I run the command

time perl -e 'use threads; $T=12 ; foreach (1..$T) { $thr[$i++] = threads->create(sub { printf "I am thread %s\n", threads->tid(); foreach (1..9e6) { push(@a, sqrt(1234)/sin(1234)*cos(1234)) } ; printf "thread %s finished.\n", threads->tid(); }); } foreach (0..$T-1) { $thr[$_]->join(); }'

I see 2.6.37 being 80% slower than 2.6.34. The command just starts 12 threads calculating sqrt(1234)/sin(1234)*cos(1234) 9.000.000 times and waits for all threads to finish.

I ran these tests on a dual Xeon X5650 @ 2.67GHz (6 cores with HT) with 24 GB memory, openSUSE 11.3, kernels 2.6.34.7-0.5-default and kernel-default-2.6.37-6.1 from http://download.opensuse.org/repositories/Kernel:/stable/openSUSE_11.3/x86_64/ .

Is this slowdown expected? Can anyone confirm these results and test the previous command on 2.6.34 and 2.6.37 on your own hardware? If you run the above command, adjust $T to your number of cores. If you run out of memory, decrease the inner loop (1..9e6) to (1..9e5) or similar.

Thanks, Richard

share|improve this question

1 Answer 1

Are you sure that you have the same configuration in both kernel ?

share|improve this answer
    
I didn't compile the kernels myself. It's just the openSUSE compiled kernels. The configs are "similar" but not the same, there are many differences from 2.6.34 to 2.6.37. The most important difference I found was CONFIG_HZ=1000 on 2.6.37 versus CONFIG_HZ=250 on 2.6.34. –  rems Feb 8 '11 at 14:54
    
No, I was wrong with the CONFIG_HZ thing. Both default kernels are compiled with CONFIG_HZ=250, I was wrongly comparing a default versus a desktop flavor config file. I am rerunning the tests now again, but I am almost sure the tests I did before ran both on default flavor kernels. –  rems Feb 8 '11 at 15:45
    
Probably it's a matter of proper configuration. If you have not compile everything yourself it's not so easy to find what's the problem. In any case i'd suggest to remove the printf in order to reduce the I/O –  Nikolaidis Fotis Feb 8 '11 at 16:07
    
After rerunning my test I can confirm that the slowdown is there. The CONFIG_HZ is on both default kernels set to 250 HZ. –  rems Feb 8 '11 at 16:16
    
The printf is just printing 12 lines at the start and 12 at the end, not really much. I tried removing both printf, and as I have expected, that made no difference. –  rems Feb 8 '11 at 16:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.