How do different Linux distributions handle multiple cores and multi-threading?

8

3

I realize that by asking this question I have already labeled myself as "unprepared" for high-performance workstations, but whatever, you have to start somewhere!

I would like to know how different linux distributions handle multiple cores and multi-threading, so as to help determine which might be best for an HPC workstation.

By default I know that Linux takes advantage of several cores, but does anybody have reference links to how it handles multi-cores (in English, i.e. I don't want to read the source code ;) ) as well as performance comparison charts (re: core utilization over time, thread distribution, compile times, etc). I understand that applications must also be optimized for multi-core support, but the first step is getting the most out of the operating system.

Or am I wrong, and is Linux inherently the same in this regards, no matter the distribution, and instead performance will be all application based?

Jonathan

Posted 2010-10-11T05:40:00.410

Reputation: 1 122

1This question might as well be titled. "Begin a flame war over which Linux distro is best below." Honestly, for the question to be answerable, we need a bit more to go on than just "high performance". If your question is really "Do distributions differ in how they handle multithreading?" then ask THAT question, not this one. – frabjous – 2010-10-11T06:00:26.820

I don't mean to start a flame-war :( I hate them as much as the next practical individual. I will rephrase my question. Sorry. – Jonathan – 2010-10-11T06:12:28.387

I thought the question was posed pretty well, then again I'm all for knowledge and don't care much for flaming. It's a question I'd like to see answered... – invert – 2010-10-11T07:52:22.043

wez, the question has been changed since I wrote my comment, and much for the better! (Originally it was something like "which linux distro is best for high performance?") – frabjous – 2010-10-11T15:53:52.760

Answers

3

How do different Linux distributions handle multiple cores and multi-threading?

The scheduling of processes is really up to the kernel. See a, b, c and d. Yes, there's sourcecode in some of those links. But it's not really avoidable when dealing with something this low-level.

ta.speot.is

Posted 2010-10-11T05:40:00.410

Reputation: 13 727

That's true, most (if not all) distributions use multicore-ready kernel. But the kernel is not the only part of operating system. Unfortunately, most applications, also the system utilities are full of legacy synchronous single-core code. Sometimes there are parallel versions of them, and it's up to distribution to choose them over the single-core versions. In an extreme case, I could imagine a distro that allows only multicore code in their repos. Although, I think it would lack most important parts of the system. It's sad, having in mind that first Intel Core Duos were released 12 years ago. – Maciek Łoziński – 2018-04-24T09:45:06.203

5

There will be minor differences between distributions. Ubuntu might use XYZ scheduler and Fedora might use ABC scheduler and that results in a X% improvement. But the bigger problem is application support. You can have a single-core CPU or a 12-core CPU, but if the application is single-threaded, you're going to end up with the same performance. In this situation, I would use whatever I felt more comfortable using in the long run.

Nick

Posted 2010-10-11T05:40:00.410

Reputation: 981

2I thought the scheduler was part of the kernel. Sure, someone could change it, but that seems like it'd be a lot of work. Distros often have subtly different userspace stuff, but how many actually make a major change to the kernel itself? – cHao – 2010-10-11T07:50:42.187

@cHao - there are different schedulers that you can tell the kernel to use. – ta.speot.is – 2010-10-11T09:11:45.753

Your answer is very helpful, thank you, but I really like the sources that taspeotis provides below. Thanks to everyone for their help! – Jonathan – 2010-10-11T09:20:38.650

@cHao - the kernel has several scheduling options precisely because what is optimal for some CPU arrangements and tasks is very much not optimal for others. Most stock kernels have them all compiled in so you can switch between them as a boot-time option, the most desktop distributions will default to the one that is commonly held, at the time of that distro's release, to be the best choice for general desktop use. – David Spillett – 2010-10-11T09:44:27.237

1

Linux distributions have been multi-core and multi-thread in the kernel via SMP for years now.

It is not the distribution that is important in this case, but the kernel. And since all major distributions are today based on the same kernel, just take your pick.

This website should help decide among Linux distributions : Comparison of Linux distributions.

harrymc

Posted 2010-10-11T05:40:00.410

Reputation: 306 093

Thanks for answering. I have been using linux now for almost a decade, so I have a pretty good handle on the general-purpose differences between each distribution. I was particularly hoping to focus on multi-core aspects and performance metrics related to those. But I am struggling as to how to word what I want. Cheers! – Jonathan – 2010-10-11T08:08:25.260

In this case you might stay with what you know best. – harrymc – 2010-10-11T08:56:09.287

0

Though most distros use the stock kernel there are a couple that have differences that affect specific computing requirements. Redhat (http://www.redhat.com/mrg/realtime/) and SUSE (http://www.novell.com/products/realtime/) both have realtime kernels which affect how threads are scheduled.

Rich Homolka

Posted 2010-10-11T05:40:00.410

Reputation: 27 121