LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-28-2017, 06:57 PM   #1
adolfoe
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Rep: Reputation: Disabled
SMP and Hyperthreading on single-core processor x86


Is there any consequence on enabling the SMP and HT kernel capabilities if you are going to use an x86 single core processor?

Is it better to disable those features? Is there any advantage on disabling them?

Thanks in advance for your help.
 
Old 06-28-2017, 07:29 PM   #2
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
If only have one processor, SMP is a moot issue, isn't it? Wouldn't that require more than one processor or at least core?

As far as hyper threading, I don't see why you would turn it off.
 
Old 06-28-2017, 07:55 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
Old 06-28-2017, 08:23 PM   #4
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,041

Rep: Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219
If a single core processor also has hyperthreading, as did the Intel P-4 processors, wouldn't you want to use the SMP kernel?
 
Old 06-28-2017, 09:08 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
Old 06-28-2017, 11:16 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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
 
Old 06-29-2017, 03:58 AM   #7
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,041

Rep: Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219
One of my old boxes was a 64 bit single core Intel P-4 with Hyperthreading that the kernel reported as a dual core.
 
Old 06-29-2017, 08:46 AM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
Old 06-29-2017, 09:01 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
Old 06-29-2017, 09:10 AM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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.
 
1 members found this post helpful.
Old 06-29-2017, 09:22 AM   #11
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by sundialsvcs View Post
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.
 
Old 06-29-2017, 10:29 AM   #12
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,041

Rep: Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219Reputation: 7219
An Intel i7 should be a quad core chip, so with Hyperthreading you would see eight cores.
 
Old 06-29-2017, 11:04 AM   #13
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
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.
 
Old 06-29-2017, 06:54 PM   #14
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by cwizardone View Post
An Intel i7 should be a quad core chip, so with Hyperthreading you would see eight cores.
Yes, and it does show up as 8 processors, as I said. Usually only re-encoding a movie or something can get all eight to near 100%.
 
Old 06-30-2017, 06:41 AM   #15
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SMP kernel not seeing multiple cores/threads for Intel Core i7 870 processor honnefinger Linux - Kernel 10 04-18-2011 11:55 PM
SMP kernel performance on single processor ColInvictus Linux - Kernel 1 10-26-2009 07:33 PM
SMP Kernel on a Single Processor eglow Linux - Hardware 2 08-04-2006 04:28 AM
Dual Core, Hyperthreading, Dual Processor sohos Linux - Hardware 1 04-20-2006 02:21 PM
SMP Hyperthreading beezneez Linux - Hardware 0 05-14-2004 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:23 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