LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-24-2007, 10:44 PM   #1
tntcoder
Member
 
Registered: Sep 2003
Distribution: Arch
Posts: 89

Rep: Reputation: 15
Multi-core CPU Question


Hi,

Assuming the Linux kernel has the correct CPU options compiled in, how efficient is it at utilizing multi-core CPUs? I ask because i read something the other week about how Microsoft are going to have to rewrite most of the Windows kernel to take advantage of future CPUs when they exceed 4 cores.

So currently I am using a 2 core CPU and hopefully soon a 4 core, does the kernel automatically share threads between the 2 cores? Or is it up to the application to delegate thread affinity? And is there going to have to be a major rewrite of the linux kernel to use multicores effectively in the future?

Thanks alot,

Jack
 
Old 06-24-2007, 11:21 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The x86 Linux kernel works "out of the box" with up to 32 CPUs/cores, though the largest supercomputing clusters running Linux run on over 65,535 processors.

I ran Linux on an 8 CPU machine (single image) in 1998. I don't think you'll have any problem.
 
Old 06-25-2007, 08:21 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
A multi-core CPU is a simplified version of "a true multi-CPU machine." But the Linux kernel treats it (more or less) the same.

It is your responsibility as an application programmer to specify what your application requires, not to determine how the operating system services those requirements. The operating system's job is to manage the system as efficiently as it can, given the current workload and the nature of the hardware.

Never the twain shall meet.
 
Old 06-26-2007, 06:54 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
While applications don't get directly involved in the management of system resources, there are ways in which applications can be structured to allow the OS to better utilize multiple processors/cores.

Large CPU intensive monolithic applications will see little benefit from SMP. While multiple such applications can be scheduled and dispatched concurrently by the OS, each application is limited to the processing resources of a single CPU. This is less of a concern for advanced users that naturally have a high multitasking behavior. For example, transcoding several videos/mp3s in the background, while running multiple concurrent file transfers.

By forking sub-processes or using threads, a single application can be scheduled/dispatched by the OS to span multiple CPUs. The tricky thing about this is that such an application structure has an overhead that a monolithic structure does not (i.e., it's less efficient). This means that on a system with a single CPU, the application will have a lower throughput than a monolithic equivalent. Some applications (e.g., make) allow you to manually specify a level of concurrency, reconfiguring the structure at runtime. Doing this increases complexity for the user, obviously.

This is really only a transitional issue. SMP, with the introduction of multi-core chips, is becoming the norm. As a result, all applications should be structured to break large monolithic segments into threads/subprocesses going forward. The end result for the user is that, with no intervention, processing intensive activities will fully exploit multiple CPUs.

Last edited by macemoneta; 06-26-2007 at 06:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
searching for multi-cpu display applet (kde) cheesus Linux - Desktop 4 05-23-2007 12:20 PM
multi boot MINIX3 with Fedora core 6 ?? swami.kmb Linux - Software 1 04-25-2007 08:33 AM
Dual / multi-core programming questions markelo Programming 3 11-12-2006 05:43 PM
What does multi-cpu benefits from ??? pleasehelpme Linux - General 3 05-11-2005 11:19 PM
redhat 8 , multi cpu and wirless NIC fillerf Linux - Newbie 1 12-20-2002 06:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration