LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware SMP kernel (https://www.linuxquestions.org/questions/slackware-14/slackware-smp-kernel-843634/)

user100 11-11-2010 04:56 AM

Slackware SMP kernel
 
Hi,

How well does Slackware, or a Linux SMP kernel, use a dual-core or quad-core processor in general?
Does it use it at least to run itself and everything that comes with Slackware in this case?

Or is it still that an application or program has to be written to use multi-core processors or is it default based on the kernel ability to use multiple processors?

I'm trying to determine whether a dual-core or quad-core processor (or even a hexacore) is being used and worth the money for linux.

And also for a standard slackware server for internet-sharing, firewall, file sharing and some other basic stuff that comes with Slackware or something I may install. But the first part is also for general purpose and information.


Thanks.

rfernandez 11-11-2010 05:36 AM

I have a Intel Core i5 and multiprocessing is kernel-native, for me it's very well supported. You can, nonetheless, control the processor usage, which so far I haven't done so. Earlier I had a Core 2 Duo which also worked flawlessly with SMP kernel.

onebuck 11-11-2010 06:18 AM

Hi,

Look at Linux SMP HOWTO: to get some understanding & tidbits of useful information. Some of the presentation is dated but provides links that will extend. I like this section;

Quote:

excerpt from http://tldp.org/HOWTO/SMP-HOWTO-3.html
3.2 User Side

Do I really need SMP? If you have to ask, you probably don't. :) Generally, multi-processor systems can provide better performance than uni-processor systems, but to realize any gains you need to consider many other factors besides the number of CPU's. For instance, on a given system, if the processor is generally idle much of the time due to a slow disk drive, then this system is "input/output bound", and probably won't benefit from additional processing power. If, on the other hand, a system has many simultaneously executing processes, and CPU utilization is very high, then you are likely to realize increased system performance. SCSI disk drives can be very effective when used with multiple processors, due to the way they can process multiple commands without tying up the CPU. (C. Polisher)
When you read the HOWTO, notice the names for some of the contributors.

Quote:

Other points about SMP Programming
  1. Where can I found more information about parallel programming? Look at the Linux Parallel Processing HOWTO
    Lots of useful information can be found at Parallel Processing using Linux
    Look also at the Linux Threads FAQ
  2. Are there any threaded programs or libraries? Yes. For programs, you should look at: Multithreaded programs on linux (I love hyperlinks, did you know that ? ;))

:hattip:

GazL 11-11-2010 06:35 AM

When I had to replace my old box last year, I chose to go for a 2.8Ghz duo rather than a 2.4ghz quad. The higher clock speed is of more benefit to me than a couple of extra cores that would have probably stood idle for the majority of the time. And I also saved a little money as the duo was much cheaper at the time.

A server or a number crunching setup might be different, but for a general desktop system, there's still not that much need for more than a couple of cores IMO.

user100 11-11-2010 07:36 AM

Well I was more looking for a "person" answer, onebuck. But thanks very much for the good information. :)

My preference for making muticore apps would be OpenMP. Btw the "Multithreaded programs on linux" link is dead.

Just running slackware on its own, does it use those cores at all? Running the standard apps that come with it? Or aren't they multithreated supported?

Even for like compiling stuff with gcc or something. I don't need video editing in which I could chop it up and divide it between the cores, that is at least how its supposed to work. :)

So from what I gather running a single core I would probably be better off since the stuff/apps/programs doesn't really make use of it to that extend or supports it, right?

onebuck 11-11-2010 07:59 AM

Hi,

Quote:

Originally Posted by user100 (Post 4155719)
Well I was more looking for a "person" answer, onebuck. But thanks very much for the good information. :)

My preference for making muticore apps would be OpenMP. Btw the "Multithreaded programs on linux" link is dead.

Just running slackware on its own, does it use those cores at all? Running the standard apps that come with it? Or aren't they multithreated supported?

Even for like compiling stuff with gcc or something. I don't need video editing in which I could chop it up and divide it between the cores, that is at least how its supposed to work. :)

So from what I gather running a single core I would probably be better off since the stuff/apps/programs doesn't really make use of it to that extend or supports it, right?

The content was from several known Kernel contributors. So it would seem you would be getting first person information.
That's what happens with dated links, some useful information is lost.

As to the Slackware query about smp, you have the option for smp with x86_32 bit by choice of huge.s or hude-smp.s. For x86_64 it's handled by the kernel.

It's not just application specific, but it will be limited by the bottleneck for subsystems.
:hattip:

catkin 11-11-2010 08:20 AM

Quote:

Originally Posted by user100 (Post 4155719)
So from what I gather running a single core I would probably be better off since the stuff/apps/programs doesn't really make use of it to that extend or supports it, right?

Even if you don't have many multi-threaded apps, you do run many simultaneous processes and Linux is very capable of distributing processes between CPUs. A system monitor such as GKrellM shows this nicely.

hitest 11-11-2010 09:14 AM

Code:

Linux odin 2.6.35.7-smp #2 SMP Mon Oct 11 14:52:09 CDT 2010 i686 Intel(R) Pentium(R) D CPU 2.80GHz GenuineIntel GNU/Linux
I dual boot XP Pro SP3 and Slackware-current on my main machine. For me the SMP kernel runs very smoothly; my system is responsive.

user100 11-11-2010 10:44 AM

Yes but how useful is it?

I know it runs well and which kernel to use. But how useful is it and how well does it uses it.

Ilgar 11-11-2010 11:43 AM

I think it is difficult to answer "how well?", how do we measure this? Probably all operating systems around have more or less compatible policies of load distribution (in case of a multicore PC). I have an EeePC which has a dual core Atom. This one is not a very strong processor but I'm happy with the responsiveness, even under load, say, when compiling software in the background. I think the extra core helps here, as compiling will typically use one core at a time and even if that one chokes, the other one is available for other stuff. But obviously, the end result will be same if you have a single core with sufficiently higher frequency.

allend 11-11-2010 06:28 PM

Quote:

know it runs well and which kernel to use. But how useful is it and how well does it uses it.
I recently was compiling kernels on an Atom dual core processor, a highly CPU intensive task.
Doing the compile with 'make bzImage modules' took a little over 3 hours. 'top' showed the processor usage fluctuating between 50% to 90% for most of the time.
Doing the compile with 'make -j3 bzImage modules' took about 1 hour and 40 minutes. 'top' showed the processor usage running at about 90% almost continuously.

lumak 11-12-2010 08:51 AM

If it's a highly intensive program, each process that the program requests is going to take up a percentage of the CPU load.

With 'make' if you want to compile more than one piece of the program at a time, you have to use the '-j/--jobs=' option. On a single core processor and enough memory, --jobs=2 may even get you a boost in compile time. If the person used custom make files instead of the autotools then this may not do anything.

That being said, I would think that each program has to take advantage of sending multiple things to the processor. BUT! the kernel is going to use all available resources to run any given program. So I'm sure SMP helps with multi tasking.

Not to mention, the default kernel for any 32bit linux is going to be SMP enabled and any Pentium Pro is going to support it. If you have anything older, then you may actually have to use a non SMP kernel.


Then better question is "Why are you even worrying about such things?" If you are buying a used computer, then it's more than likely going to be SMP compatible and you don't care about speed because it's an older computer. and if you are buying a new computer it definitely is going to run on an SMP kernel and is going to be faster than an older processor regardless of whatever the settings are and if a program supports it or not.

corbis_demon 11-12-2010 10:14 AM

OK, I'm confused here, is SMP an advantage only on those machines with multiple processors (like servers), or also on those with a single processor housing multiple cores?

user100 11-12-2010 11:29 AM

No that would be equal to each other.

The last post was a bit confusing indeed but I follow.

I'm not so sure about the last part though where the kernel was supposed to "move" software or programs to use multicores itself.

It would almost bring another question. But let's stick to this for now. :)

T3slider 11-12-2010 04:19 PM

The OS can designate different processes to run on different cores. One process will only ever use one core unless it has been programmed specifically to take advantage of multiple threads. If you run multiple CPU-heavy processes at once, multiple cores (and of course an SMP-enabled kernel) will be significantly faster and smoother than running both processes on one core. If you only ever run one CPU-heavy process at a time, the performance gain may be more minimal unless you are using programs that spawn multiple threads (make -j, video encoding with mencoder/ffmpeg, etc.). I had a dual core processor in my old PC (now my server) and I have a quad core in this one. There is a noticeable improvement in compile times and definitely an improvement in video encoding times (when explicitly specifying the number of threads to spawn). In addition, when running multiple CPU-heavy operations at the same time, it is much smoother. I wrote random data over a 1TB drive (which was a painful and lengthy process), but my PC was still usable throughout that period, mostly because of the availability of multiple cores (and hence random data generation used only one core). It would have been a much more painful experience on my old PC.

In the end, it depends on what you're doing with your computer. If you are running multiple CPU-heavy applications and/or using applications that have the ability to spawn multiple threads, more cores will improve your experience. If you generally only ever run one CPU-heavy application, and you do not use any programs that can spawn multiple threads, then perhaps you would benefit most from a faster clock speed with fewer cores.


All times are GMT -5. The time now is 03:37 PM.