[SOLVED] SMP and Hyperthreading on single-core processor x86
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I must say I was surprised by the question. Been so long since I had even considered it, I thought it would no longer even be an option. But it is ... On my 4.12 rc5 kernel, the help (still) says
Code:
CONFIG_SMP: │
│ │
│ This enables support for systems with more than one CPU. If you have │
│ a system with only one CPU, say N. If you have a system with more │
│ than one CPU, say Y.
There is more of the same. I was going to opine that it wouldn't matter, but I would defer to the build authors.
It would (presumably) still be just the one core - cpuinfo will show that. SMT is a scheduler option - specifically for the P4 according to the help.
I have an old P4 gathering dust somewhere, but I'm pretty sure it wasn't single core. I'll go look for it later.
Looking at my dust collector, which actually is a single core hyperthreaded P4, it doesn't seem to matter. The default Fedora config has it as SMP - been a long time since anyone shipped both a UP and SMP kernel set. Relevant info:
Code:
----cpuinfo--------
processor : 0
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
processor : 1
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
----config---------
CONFIG_X86_32_SMP=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_SMP=y
CONFIG_X86_BIGSMP=y
CONFIG_SCHED_SMT=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_SCSI_SAS_HOST_SMP=y
CONFIG_I2C_ISMT=m
CONFIG_VIDEO_VP27SMPX=m
----inxi-----------
CPU: Single core Intel Pentium 4 (-HT-) cache: 512 KB
clock speeds: max: 2800 MHz 1: 2800 MHz 2: 2800 MHz
My experience is there is no significant consequence. I mean, if you really want to scrimp and save on a few bytes of RAM and imperceptibly improving boot time, then getting rid of the modules can help.
But otherwise, why bother with the extra effort?
I had (before it just died a couple months ago) a 64 bit hyperthreading P4 and it worked fine. Also, I have a couple old Atom based machines, which are 32 bit hyperthreading. In both cases, the kernel reports two cores.
I also have a LOT of 32 bit Socket 732 AMD Sempron machines, all of them boring single core and they work fine with those modules in the kernel.
Basically, I just use the vanilla Debian 686-pae and amd64 kernels, no tweaking on my part. They include those modules, and it basically all just works out-of-box. Single core, dual core, quad core, hyperthreading, no hyperthreading, 32 bit, 64 bit...it all just works.
Agreed. I remember using gentoo on my P4. Very little buy-back from compiling all night to change something like this. Just run with what you have unless you have real good reasons not to.
My experience with Hyperthreading is also that it is mostly smoke-and-mirrors. The concept was to exploit a peculiarity of the physical instruction pipeline to allow for the illusion of "two cores" when there is only one physical execution unit. And, if a real-world workload actually consisted of balls-to-the-walls CPU activity, which never needed to flush the pipeline, it might produce some improvement. (But, certainly not "+100%.") However, it fools the operating system into thinking that there really are two cores there.
In my experience, "if you need multiple cores," buy a chip that supports them – and the accompanying motherboard, which must actually have the memory hardware needed to actually do SMP. (Even though "cores" are not really "SMP" at all.) Fair warning: plenty of systems are sold with fancy-pants chipsets without the supporting hardware needed to actually let them be of any use.
My experience with Hyperthreading is also that it is mostly smoke-and-mirrors. The concept was to exploit a peculiarity of the physical instruction pipeline to allow for the illusion of "two cores" when there is only one physical execution unit. And, if a real-world workload actually consisted of balls-to-the-walls CPU activity, which never needed to flush the pipeline, it might produce some improvement. (But, certainly not "+100%.") However, it fools the operating system into thinking that there really are two cores there.
In my experience, "if you need multiple cores," buy a chip that supports them – and the accompanying motherboard, which must actually have the memory hardware needed to actually do SMP. (Even though "cores" are not really "SMP" at all.) Fair warning: plenty of systems are sold with fancy-pants chipsets without the supporting hardware needed to actually let them be of any use.
As an Apple guy all my life, I'm fairly new to Intel, but as I understand it there are some things hyperthreading can do in parallel and some things it can't. I'm not sure off the top of my head what is what. But I have a MacBook Pro with a single Core i7 processor that shows up as having 8 processors but I think it's not any faster than my older Mac Pro that has two real Xeon processors with two non-hyperthreading cores each and shows up as four processors.
If you have a single core 32 bit CPU which is older than a Pentium 4, you may as well build a "pentium pro" (P6) kernel with PAE/NX support enabled, but without SMP or HT support.
Hyperthreading is basically a marketer's illusion to make the system appear to be twice as big as it really is.
If you have a single-core CPU, you should compile Linux without SMP support. This will eliminate a lot of locking and synchronization code within the kernel that you simply do not need.
If you do, cut the number of perceived CPUs in half and the system just might run faster.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.