Slashdot Mirror


Linux 2.6 And Hyper-Threading

David Peters writes "2CPU.com has posted an article on Hyper-Threading performance in Linux. They use Gentoo 1.4 and kernel 2.6.2 and run through several server-oriented benchmarks like Apache, MySQL and even Java server performance with Blackdown 1.4. The hardware they use in the tests is border-line ridiculous (3.2GHz Xeons, 3.2GHz P4 and P4 Prescott) and the results are actually quite interesting. It's a good read as he even takes the time to detail his system configuration all the way down to the CFLAGS used while compiling the software."

19 of 51 comments (clear)

  1. License software based on # of CPUs by fredrikr · · Score: 2, Insightful

    Has anybody run into a problem with Hyper-Threading and per-CPU licensing?

    1. Re:License software based on # of CPUs by MerlynEmrys67 · · Score: 3, Interesting
      I haven't - but then I don't run Oracle and many of the "per CPU" server applications.

      I'm really waiting to see what these vendors will do when true Multicore CPUs are popular with the unwashed masses.

      Especially when there are 4-16 cores per CPU

      --
      I have mod points and I am not afraid to use them
    2. Re:License software based on # of CPUs by Anonymous Coward · · Score: 2, Informative

      This is, I think, going to be more of a problem in the Windows world than the Linux world.

      There should only be the problem of under-utilization if the software doesn't support multiple processors. The software should not (if it's correctly designed) cease to function if it suddenly detects more than the number of processors it's licenced for - it should simply run on however many processors it was expecting.

      A possible work-around (if there is some multithreaded software that fails in a multiprocessor environment) in Windows NT / 2000 & XP Pro you can set a CPU affinity mask (either manually through task manager or if you launch the process through a particular API call). This is a 32-bit wide bitfield that indicates which CPUs the task is permitted to access (bit 0 = cpu 0, bit 1 = cpu 1, etc).

      Windows XP Home would be the most likely problem that anyone runs into as it only has single processor support. But it should still work. And nobody except mom & dad should be running XP Home anyway.

      FYI, Windows 2000 Pro supports 2 processors and works well with the hyperthreaded CPUs straight out of the box with no problem (this is what I'm running on the machine I'm typing on). However - if the number of CPUs changes (say, swapping out a single threaded CPU for a hyperthreading one), I believe you need to reinstall the operating system (because you'll otherwise be running the single-CPU kernel files).

    3. Re:License software based on # of CPUs by saden1 · · Score: 2, Insightful

      If it is on one chip, it is one CPU. I'll be damned If I'm going to pay more.

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
    4. Re:License software based on # of CPUs by kayen_telva · · Score: 5, Informative

      actually, Intel recommends against using HyperThreading with Win2K (all flavors)

      Intel.com

      it will run but performance sucks

  2. Says who? by Anonymous Coward · · Score: 5, Interesting

    The hardware they use in the tests is border-line ridiculous

    I'm typing this on a 3.0 GHz Pentium 4 that has hyperthreading. The entire system cost me $1200 to build just before Christmas - including 1GB of RAM, a Radeon 9800 Pro video card and a 120GB SATA hard drive. Dell and IBM sell 3GHz notebooks now for a similar price.

    My point is that a 3.2GHz CPU is not ridiculous in an age where 2.66GHz processors are considered entry-level (FYI, Dell is currently selling a 2.66GHz desktop for $499).

    What are you still running on? A 486?

    1. Re:Says who? by MikeCapone · · Score: 4, Funny

      What are you still running on? A 486?

      I will *not* answer that question!

      *door slams*

  3. Redo. by BrookHarty · · Score: 4, Funny

    Ok, Time to redo the benchmarks, Kernel 2.6.3 is out.
    [joking]

    Be nice when we see some nice Opteron benchmarks vs the new Xeons.

    -
    "But Calvin is no kind and loving god! He's one of the _old_ gods! He demands sacrifice!"

  4. Cute comment on compiling by MerlynEmrys67 · · Score: 3, Informative
    Of course my opinion is why not use as large of a -j as you can, and distribute the problem. Take a server farm and turn your compile into ccache and distcc (look up the projects on samba.org CCache distcc)

    The first one performs semi-miracles on repetative build times where you aren't doing "incremental" builds. The second lets you distribute your compile to multiple build servers on the network (beware - there be deamons here)

    Build times went from hours to minutes - it was great

    --
    I have mod points and I am not afraid to use them
    1. Re:Cute comment on compiling by addaon · · Score: 2, Interesting

      Built into ProjectBuilder, using Rendevous, on all current macs.

      --

      I've had this sig for three days.
    2. Re:Cute comment on compiling by addaon · · Score: 2, Informative

      Here, if you have decent hardware.

      --

      I've had this sig for three days.
  5. Tantalizing . . . by Mysteray · · Score: 4, Interesting

    Those sure are some interesting numbers. On the order of a 49% increase or 35% decrease in performance depending on the application. I always figured those high-GHz CPUs would be completely IO-bound. I guess this sometimes allows threads to run with what they've got in the on-chip cache.

    Makes you wonder if a kernel could detect if it was helping or not and selectively enable it.

    I did some informal testing between VC++ native and C# to .Net bytecode. I had a little loop calculating primes. The native C++ kept everything in registers, while the CLR made everything relative memory accesses to BP. I figured that would devastate performance, but on the Pentium 4, it was only 5% slower! It seems to have an L1 cache that's as fast as the registers. That will certainly make it easier on the compiler writers.

    Sort of off topic, did anyone else see that article in MSDN about using .Net for serious number crunching? The author seemed to write the whole article as if he thought it was a good idea. Not that there wouldn't be some advantages to doing that (such as the possibility of tuning for the processor at runtime), but the one graph he showed comparing with native code had .Net running 50% to 33% slower!

    1. Re:Tantalizing . . . by metalix · · Score: 5, Funny

      I did some informal testing between VC++ native and C# to .Net bytecode. I had a little loop calculating primes. The native C++ kept everything in registers, while the CLR made everything relative memory accesses to BP. I figured that would devastate performance, but on the Pentium 4, it was only 5% slower! It seems to have an L1 cache that's as fast as the registers. That will certainly make it easier on the compiler writers.

      oops you just violated the VS.NET EULA by posting a performance benchmark. shame on you!

    2. Re:Tantalizing . . . by Mysteray · · Score: 2, Insightful
      Well 50% slower isn't really a problem -- you could just wait a year or two and run it on newer hardware at the same speed as the C++ program would have run.

      Or just write it in C++ in the first place and:

      • have the results of your computation a year or two sooner
      • have a product that's not half as fast as your competitors'
      • have a product that runs faster on newer hardware instead of one that performs like it's on yesterday's hardware
      • save your customers' money on hardware and claim some of that back on your sale
      • have a product that has a chance at portability
      • have a product that is suitable for people who have computers today, instead of the (much smaller) market segment of people with computers from the future
    3. Re:Tantalizing . . . by be-fan · · Score: 2, Interesting

      The P4 seems to handle indirect accesses extremely well. They did a benchmark of bcc awhile ago. Bcc is a version of GCC that does bounds checking. Now, bounds-checking in C sucks because you have arbitrary pointer arithmatic. So a pointer balloons from a 4-byte word that fits in a register, to a 12-byte structure that must be accessed indirectly. On a P3 and an Itanium, the penalty was huge, reaching 117% for the P3. However, the penalty on the P4 was only 34%.

      --
      A deep unwavering belief is a sure sign you're missing something...
  6. Re:Money? by Anonymous Coward · · Score: 3, Insightful

    Well the hardware is provided by the manufacturers for review (it is a hardware site after all). SPEC doesn't just go around handing out copies of their (very expensive) benchmarking applications.

  7. Re:They need -mm by Anonymous Coward · · Score: 5, Insightful

    You are an idiot. To start with, a CPU with HT has two discrete visible register sets. If you are so smart, how would you fix this imaginary performance hit by "handling" registers better

    Second, the SMT scheduler in -mm kernels isn't a hack. It is a general and extensible topology description that the scheduler uses to achieve exactly the behaviour it needs.

  8. Re:They need -mm by HRbnjR · · Score: 4, Interesting

    For the record though, the important point was that the stock 2.6 kernels do not yet handle HT in an ideal manner. The article doesn't mention if the Gentoo kernel used for the benchmarks is HT patched or not.

    And with special thanks to Zack Brown, those interested can read summaries of HT issues here:

    http://www.kerneltraffic.org/kernel-traffic/topics /Hyperthreading.html

  9. Whats the big deal? by Anonymous Coward · · Score: 2, Funny

    My entire lab at school is filled with Dual 3.2GHz Xeons with Quadro fx 1000 cards. People have those types of machines... or 100 of them.