News for hackers. Stuff that matters.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by riffraff on Tuesday November 16, 2010 @10:48AM (#1910435)
OT: is "make -j64" overkill unless you have dozens of cores or am I missing something?
Re:The ~200 Line Linux Kernel Patch That Does Wonders by fragmede on Tuesday November 16, 2010 @11:14AM (#1910514)
You're right - but that was the point. The patch was trying to fix problems with the process scheduler, and "-j64" is going to make lots of processes that want to do work and need scheduling.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by riffraff on Tuesday November 16, 2010 @12:14PM (#1910741)
thanks, but then the "that is my tipical workload" thingy does not hold, as you rarely have >60 cpu bound processes running at the same time. Well, flash player in chrome notwithstanding ;)
Re:The ~200 Line Linux Kernel Patch That Does Wonders by mkramlich on Tuesday November 16, 2010 @05:49PM (#1912056)
If you're the head of the world's largest computer OS project, the root of the maintainer tree as it were, I would make no assumption about what his typical CPU workload is like. :)
Re:The ~200 Line Linux Kernel Patch That Does Wonders by SkyMarshal on Tuesday November 16, 2010 @05:39PM (#1912017)
It probably approximates Linus's typical workload, which I imagine involves constant compiling and testing while compiling. He's probably still CPU bound.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by juiceandjuice on Tuesday November 16, 2010 @10:52PM (#1912821)
make?
Re:The ~200 Line Linux Kernel Patch That Does Wonders by pmr_ on Tuesday November 16, 2010 @12:44PM (#1910866)
The number of jobs to run for an optimal compile time can be quite confusing. If none of the files you are going to compile are cached it is alright to run a lot more jobs then usual as a lot of them are going to wait for the disk I/O. After that twice the jobs then you have cores is mostly appropriate.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by nitrogen on Tuesday November 16, 2010 @06:17PM (#1912156)
According to Con Kolivas's benchmarks, with the BFS scheduler you just do make -j [numprocs] for best results. I can't recall if he was accounting for disk cache, though.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by rbanffy on Tuesday November 16, 2010 @12:47PM (#1910878)
How many simultaneous threads will your next computer be able to run?

Chances are it already runs at least two, most probably four. It's not unreasonable to see 4 and 8-threads as the norm. Also keep in mind we are only considering x86s. SPARCs, IIRC, can do up to 64 on a single socket. ARM-based servers should follow a similar path.

BTW, a fully-comfigured MacPro does 12. A single-socket i7 machine can do 12. I never saw a dual-socket i7, but I have no reason to believe it's impossible.

Considering that, -j64 seems quite reasonable.

Re:The ~200 Line Linux Kernel Patch That Does Wonders by derobert on Tuesday November 16, 2010 @04:07PM (#1911658)
Dual-socket i7 is called Xeon.

There are dual-socket and even quad-socket 8-core hyperthreaded xeons (the Xeon L75xx series). A 1U Intel with 64 threads will set you back about $20k.

AMD has 12-core chips, so you can get 48 cores in 4 sockets there. (But I think they only have one thread per core)

Re:The ~200 Line Linux Kernel Patch That Does Wonders by rbanffy on Tuesday November 16, 2010 @06:37PM (#1912224)
So, -j64 seems quite reasonable, if you have $20K around... ;-)

Personally, I would spend a part of the money on 2048x2048 square LCD screens. They look really cool.

Re:The ~200 Line Linux Kernel Patch That Does Wonders by Jach on Tuesday November 16, 2010 @09:38PM (#1912672)
Gentoo recommends -jN+1 where N is the number of physical and virtual cores.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by c00ki3s on Wednesday November 17, 2010 @05:10AM (#1913703)
Say I have a quadcore with hyperthreading, does this mean 4 + 8 + 1? Or is it either the physical or the logical cores (whichever is higher)?
Re:The ~200 Line Linux Kernel Patch That Does Wonders by ars on Wednesday November 17, 2010 @05:38AM (#1913762)
How do you get 4 + 8? But anyway, it's logical cores, not physical ones.

The kernel can multi-task processes, but each process still gets exclusive use of the CPU when it runs. So if it doesn't need an adder, that adder sits idle.

With hyperthreading you can run two processes at once and the CPU merges them at the instruction level making maximum use of the components on the CPU.

Re:The ~200 Line Linux Kernel Patch That Does Wonders by adobriyan on Tuesday November 16, 2010 @10:52AM (#1910445)
make -j$(2N + 1) is roughly where minimal compile times are.
Re:The ~200 Line Linux Kernel Patch That Does Wonders by jedbrown on Tuesday November 16, 2010 @11:07AM (#1910490)
Where N is the number of physical cores? I do not use hyper-threading (it tends to be bad for the floating point and bandwidth limited operations that I do), but usually find minimal compile times at N+1 jobs (but with little penalty for several more).
Re:The ~200 Line Linux Kernel Patch That Does Wonders by stingraycharles on Tuesday November 16, 2010 @11:15AM (#1910519)
It depends on many factors what the optimal number of concurrent builds is, but the bottom line is that you want to maximize your CPU utilization and minimize context switching.

If you think that one extra concurrent job is enough to fill CPU utilization in the time that other jobs are blocking on iowait, then you are fine.

So, bottom line, factors to think about:

- your i/o throughput for writing the generated object files;

- the complexity of the code being compiled, - template-rich C++ code has a lot higher CPU usage versus i/o ratio

- the amount of cores in your system

Re:The ~200 Line Linux Kernel Patch That Does Wonders by azim on Tuesday November 16, 2010 @11:44AM (#1910635)
Out of curiosity, What types of applications are you running where HT hurts performance?
Re:The ~200 Line Linux Kernel Patch That Does Wonders by jedbrown on Tuesday November 16, 2010 @12:30PM (#1910804)
Sparse matrix kernels and finite element/volume integration. For bandwidth-limited operations, it is sometimes possible to get better performance by using less threads than physical cores because the bus is already saturated (for examples, see STREAM benchmarks). For dense kernels, I'm usually shooting for around 70 percent of peak flop/s, and any performance shortcomings are from required horizontal vector operations, data dependence, and multiply-add imbalance. These are not things that HT helps with.

Additionally, HT affects benchmark reproducibility which is already bad enough on multicore x86 with NUMA, virtual memory, and funky networks. (Compare to Blue Gene which is also multicore, but uses no TLB (virtual addresses are offset-mapped to physical addresses), has almost independent memory bandwidth per core, and a better network.)

Re:The ~200 Line Linux Kernel Patch That Does Wonders by adobriyan on Tuesday November 16, 2010 @11:46AM (#1910645)
> Where N is the number of physical cores?

Yes. Dunno about HT, never used a box with it.

Re:The ~200 Line Linux Kernel Patch That Does Wonders by maggit on Tuesday November 16, 2010 @11:17AM (#1910526)
I have 4 cores with hyperthreading enabled (so 8 "threads"), and find that -j10 is the fastest.