Dual-core support: what's required, how to confirm it?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Dual-core support: what's required, how to confirm it?
I'm trying to figure out what's needed to get my Linux (Ubuntu Dapper 6.06.1) box to fully leverage the dual-core processor in my new PC, assuming this does not happen by default (??).
I see various references saying that all I need is to install a package like 'linux-686-smp', but that alone does not seem to work from the stock Dapper kernel (2.6.15.x). I also read the dual-core stuff works best and/or is only supported with kernel 2.6.18.x or above. Is this true?
In anticipation of this, I'm building an SMP-option enabled 2.6.18.6 kernel (it's building right now) to see if this works. I'll install the 'linux-686-smp' package as well...I think (I haven't gotten that far yet).
Further, how do I verify that my system is using the dual-core stuff? I also read in some places that the value should read "processor : 1" in /proc/cpuinfo (of which I copy my flavor below). Is this true? If so, then my system below is apparently not "seeing"/using/leveraging the additional "core"/processor.
An aside: I find it quite remarkable that there isn't a decent web resource that summarizes these issues and details how to address them, all in one place. There seems to be no definitive resource that I can find. Quite perplexing. This leads me to suspect that I've read bad info somewhere. But I start this thread to get to the bottom of this.
My machine details as promised; please let me know if you want more:
If you have done a search in this forum, it should provide you information that using smp enabled kernel will find the other core or processor and use it. Since you already select SMP in the kernel config and compiled it. Linux will balance the load with two processors. When using multi-threaded programs, you will see an increase in speed.
First, for admins of this board: my first post is this thread does not accurately reflect what I wrote. I suspect some formatting or data-integrity problems. This is rather disconcerting. But back to our regularly-scheduled program...
The references I've seen thus far--some of which may have been in LQ--recommended only installing the 'linux-686-smp' (or appropriate processor) package. That didn't work, at least on my 2.6.15 kernel.
Having finished the 2.6.18.6 customer kernel build, I now see the 2 processors in /proc/cpuinfo (I'd post the file's contents here if the network interface wasn't broken for the system I reference--because I accidently turned off the ethernet driver in the kernel build).
This supports the minority of references (or the one reference) that talked about requiring 2.6.18.x to have dual-core support. I'm trying to sort out these discrepencies. A little help with pointers in the right direction would be great. I spent a log of time researching this; I'd appreciate more than a "go search the forums" response.
I don't have access to a "core duo" (or ... 2), but the Ubuntu SMP kernel works fine on all previous hardware - up to the 8 way I tested.
Check your BIOS.
I doubt very much that you can "fully leverage the dual-core processor in my new PC" with Dapper. There's the small matter of getting a current gcc and it's use flags for the new chips.
Be happy if you can get get both cores running.
I don't have access to a "core duo" (or ... 2), but the Ubuntu SMP kernel works fine on all previous hardware - up to the 8 way I tested. Check your BIOS.
What 8 different ways did you test (if that's what you mean)? Can you provide specifics? What things did you test, you did you confirm, them, etc? And which kernel flavor did you test them on?
I also checked my BIOS; I have yet to see any specific reference to dual-core or multiprocessing stuff.
Quote:
I doubt very much that you can "fully leverage the dual-core processor in my new PC" with Dapper.
Exactly why is that? And if I change the kernel I use with the Dapper distribution, or the applications I run on it, might I still be able to leverage dual-core benfits?
Quote:
There's the small matter of getting a current gcc and it's use flags for the new chips.
Do you mean to suggest that no application will benefit from dual-core capability until they are build specifically for a dual-core system with a certain compiler revision, settings, etc? If so, what are these conditions? I am a software developer, I will be building and testing significant system software on these machines I'm administering that, and I'm going to want to leverage their performance appropriately.
I seek specifics.
Alas, I'm skeptical that it takes application-software recompiles to take advantage of the dual-core stuff; if I were a processor designer, I'd specifically want to enable *any* multi-threaded application to benefit, OR at least make the operating system as a whole run faster from a multi-process-system perspective. As a processor manufacturer, I would think this would help me sell more chips.
To this end, I'm also interested in what software benefit from the dual-core stuff. eg, will a singe, multi-threaded process generally run faster on a dual-core machine vs an all-other-things-being-equal, single-processor machine?
Quote:
Be happy if you can get get both cores running.
What exactly does it mean "to get both cores running"? I can see 2 processors in /proc/cpuinfo; does that mean "2 cores are running" and that my software will implicitly benefit?
I will be satifisfied when I get much-more-detailed information and can predict in advance how each environment will behave based upon a solid knowledge of how to control these parameters (in various environments) to achieve better performance. I want to know this far more than just for my single, little machine; I hope to distribute my organization's software across many machines, and I want to know how these things will affect our software's performance in various environments, if at all.
Because, if this dual-core stuff really doesn't make much difference, I will want to know that, too.
However, most of these forum discussions I see thus far are frankly talking a little bit in circles, and I want definite, hard, authoritative facts, and I want them for all Linux 2.6.* kernel systems...assuming the kernel (and not the distribution flavor) is the real issue here?
Thanks again in advance for any help,
-Matt
Last edited by mattengland; 12-31-2006 at 10:22 AM.
which appears to say that dual-core status is reflected in /proc/cpuinfo. It seems to implicitly state that if one sees more than one proc in /proc/cpuinfo, that one's system is leveraging full dual-core benefit...but I'm not sure.
I have posted similar questions to the moderated, linux-kernel@vger.kernel.org email list. If and when the moderators accept this post, I'll include a web link to it on this LQ thread.
I can see 2 processors in /proc/cpuinfo; does that mean "2 cores are running" and that my software will implicitly benefit?
This contradicts what you posted initially.
Yes - the kernel has recognised both cores and will schedule units of work on them both. Whether individual software benefits is largely dependant on the software itself - if it is multi-threaded it will be able to run 2 threads concurrently (depending on locking issues).
Single threaded software will not benefit directly - however it may benefit indirectly given that there are 2 (or more) processors available for scheduling.
To "fully leverage" (your term) any new features of new hardware requires the compiler to be aware, and the software using those features to be aware. This has always been the case - when MMX was introduced for example.
If you don't use those new features, they can be ignored.
As I said, for multi-core if you write your code multi-threaded, it will use extra processors if they are available.
I recompiled the 2.6.18.6 kernel with SMP support. I tried to mention that somewhere--sorry if I didn't.
Quote:
Yes - the kernel has recognised both cores and will schedule units of work on them both. Whether individual software benefits is largely dependant on the software itself - if it is multi-threaded it will be able to run 2 threads concurrently (depending on locking issues).
Ok, if it's just a straight threading issue (which includes the software I'm helping make) than it's no sweat--a multi-threaded app will transparently (to the program) run across both "cores"...if that's the way it works. However...
Quote:
To "fully leverage" (your term) any new features of new hardware requires the compiler to be aware, and the software using those features to be aware. This has always been the case - when MMX was introduced for example.
If you don't use those new features, they can be ignored.
As I said, for multi-core if you write your code multi-threaded, it will use extra processors if they are available.
Does this mean that software not compiled specifically for a dual-core system will not run with threads on each core?
And/or does this mean there are features beyond the threads-across-the-cores stuff that won't be leveraged for the 2 dores? If so, does anyone know what these features are?
I suggest using Gentoo. After you install all the programs that you want, include the nptl USE flag to get better performance that uses nptl. Unfortunately, you will have to emerge to do a world compile get the nptl included.
Programs like OpenSDL, Apache, some Java programs, VMware, and many others are designed for SMP systems in mind.
Dual processor or dual core is the same. Use the utility top and toggle SMP mode. The utility ps does not know how to distinguish threads.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.