Can a kernel that supports multi-core reduce cpu overhead, reduce cpu overheat

2

I found only a single core as identified by kernel from /proc/cpuinfo. Therefore I am installing a 686 pae kernel to identify all cores and get multi-core functionality.

I read about how a process can make use of more than one core if available. ie. An application must be programmed to make use of the multi cores available on a machine.

But I wonder if a 686 pae kernel is capable to divide the total processes and 1. assign a set of processes to different cores 2. share a process between different cores which can reduce the work of each core. This will in fact reduces the processes in queue and complete processes faster. Can a kernel that support multiprocessing achieve this and help reduce the cpu overhead ?

Any other methods I can follow for effectively sharing processes between the cores ?

paintbox

Posted 2014-02-03T16:38:35.287

Reputation: 573

Answers

1

One can already limit the cores a process can be executed on by setting the processes' affinity. On Linux, this can be accomplished by using taskset to limit the cores the process can be executed on. By default, Linux uses a pre-emptive task scheduler, which is almost identical to what you describe in (2). Almost all major operating systems use this kind of task scheduler, which will result in a process being run on multiple cores by default.

To actually guarantee your process runs for X amount of time on core Y, as you have implied in (1) would require the use of a real-time operating system; there is an existing real-time kernel module for Linux as well (e.g. RTLinux).


TL,DR: In response to the question How can I effectively share a process between cores? all major operating systems already do this due to the task scheduler being used. The job of an operating system is to control what process runs at what time, and where. While you can "pin" a process to a particular core (or set of cores) and disallow it from executing on other cores (via taskset), the operating system will still schedule other processes to be run on that core when the process is preempted.

If you ever need to guarantee the execution of your program for at least X amount of time on core Y, you should consider either a real-time kernel, or "tuning" the task scheduler you already use to use different pre-emption policies (or even swap out the entire task scheduler for another!). Note that only a real-time operating system will guarantee execution.

Breakthrough

Posted 2014-02-03T16:38:35.287

Reputation: 32 927

You said that all major operating systems can do this with task scheduling. So regardless of the application and with the increase in cpu load, a linux kernel is capable to use the other cores for processing, provided it is -686 release ? Secondly, even if only a single core is detected, if the cpu load avg is below .70 then -486 kernel is well enough I hope. Unless there is any other specific reason to enable the other cores. – paintbox – 2014-02-04T05:05:52.397

@FayadFami yes, the most recent Linux kernel uses this type of scheduler; it should work the same in both the -686 and -486 releases (the number of cores is irrelevant, they use the same scheduler). Note though, you won't get a performance increase at all - this only allows the operating system to simultaneously run other processes with less performance loss. – Breakthrough – 2014-02-04T17:07:14.003

You may also find these related questions useful as well: Why does CPU Time for the System Idle Process increase faster than the wall clock? and What does CPU usage for a process actually mean.

– Breakthrough – 2014-02-04T17:10:20.687