# 2.6 and hyperthreading

## Tolien

Can't seem to get Hyperthreading to work with my 2.6.7 box running 2004.2. 

Running with nolapic as a kernel option, since enabling APIC (although it's disabled in BIOS) appears to kill the network (I did see info about the issue somewhere, but can't find the page again on google). No APIC has similar effect as nolapic, removing either entry means the machine boots but the DHCP lease fails, and the box appears to "ignore" all network traffic. It's being given a DHCP lease by the router, but appears to ignore it. Setting IPs manually doesn't work either. Same on both the mobo (Asus P4C800-E Deluxe)'s onboard e1000 and a separate Linksys 10/100 NIC.

The problem is, with APIC either enabled or no, the "second" processor that should appear from the P4 Hyperthreading CPU isn't seen. 

Compiled in options for SMP to the kernel, set number of CPUs to 2, nothing.

Any suggestions would be welcome   :Cool: 

----------

## taskara

this is perhaps a stupid question  :Wink: 

but do you have hyperthreading enabled in your bios?

and if you boot to 2004.2 livecd with "smp" does 

```
cat /proc/cpuinfo
```

 show two cpus?

also, this is what I have enabled in my kernel (Abit IC7-Max3 mainboard) that gives me SMP:

Processor Type > [*] Processor Family > Pentium4

Processor Type > [*] Symmetric multi-processing support

Processor Type > [*] SMT (Hyperthreading) scheduler support (NEW)

Processor Type > [*] Preemptible Kernel

Processor Type > [*] MTRR (Memory Type Range Register) support

Power Management > [*] Power Management support

Power Management > ACPI > [*] ACPI Support (button fan processor)

APM OFF

Hope this helps  :Smile: 

----------

## lwithers

If I remember correctly, then recent kernel versions explicitly detect HyperThreaded processors. This leads to slightly better performance and also means that the kernel understands you only have a single real processor, so only one will appear.

In "Processory type and features", check that you have selected "SMT (hyperthreading)" support underneath the "SMP" option. This will enable the kernel to optimise HT usage.

----------

## taskara

 *lwithers wrote:*   

> If I remember correctly, then recent kernel versions explicitly detect HyperThreaded processors. This leads to slightly better performance and also means that the kernel understands you only have a single real processor, so only one will appear.
> 
> In "Processory type and features", check that you have selected "SMT (hyperthreading)" support underneath the "SMP" option. This will enable the kernel to optimise HT usage.

 

On my p4 system, selecting SMP and SMT still provides me with 2 cpus under /proc/cpuinfo, and more importantly, I still get 2 Tux in frambuffer!  :Very Happy: 

----------

## Tolien

 *taskara wrote:*   

> this is perhaps a stupid question 
> 
> but do you have hyperthreading enabled in your bios?

 

Experience shows there's no such thing as a stupid question  :Laughing: 

It's enabled

 *taskara wrote:*   

> and if you boot to 2004.2 livecd with "smp" does 
> 
> ```
> cat /proc/cpuinfo
> ```
> ...

 

Just the one.

 *taskara wrote:*   

> also, this is what I have enabled in my kernel (Abit IC7-Max3 mainboard) that gives me SMP:
> 
> Processor Type > [*] Processor Family > Pentium4
> 
> Processor Type > [*] Symmetric multi-processing support
> ...

 

All of those are set as that   :Confused: 

 *Quote:*   

> 
> 
> In "Processory type and features", check that you have selected "SMT (hyperthreading)" support underneath the "SMP" option. This will enable the kernel to optimise HT usage.

 

The contents of /proc/cpuinfo are:

```
processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 2

model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz

stepping        : 9

cpu MHz         : 3007.391

cache size      : 512 KB

physical id     : 0

siblings        : 2

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 2

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid

bogomips        : 5963.77

```

So presumably it's spotting that HT support is there, with the ht flag.

----------

## mgleed

Have you tried passing acpi=ht to your kernel at boot time?

----------

## malv

What is the latest concensus about the true merits of hyperthreading?

From past publications it appears that hyperthreading can even result in a marked decrease in performance especially in database applications.

Anymore about this?

----------

## John5788

can u boot up with the livecd or knoppix and have it detect the hyperthreading? or maybe u forgot to enable hyperthreading in your bios?

----------

## Tolien

 *mgleed wrote:*   

> Have you tried passing acpi=ht to your kernel at boot time?

 

Yup, nothing.

 *John5788 wrote:*   

> can u boot up with the livecd or knoppix and have it detect the hyperthreading? or maybe u forgot to enable hyperthreading in your bios?

 

 *Tolien wrote:*   

> 
> 
>  *Taskara wrote:*   
> 
> but do you have hyperthreading enabled in your bios? 
> ...

 

 *Tolien wrote:*   

> 
> 
>  *Taskara wrote:*   
> 
> and if you boot to 2004.2 livecd with "smp" does
> ...

 

----------

## taskara

Dude,

your FLAGS of your cpu (from output of /proc/cpuinfo) tell me that your CPU does indeed support HT (the little "ht" flag).

When you booted to the 2004.2 Livecd, did you choose 

```
smp
```

 from the boot prompt?

Because it should then load the SMP kernel, and cat /proc/cpuinfo should definately show two cpus (it does for me).

Can you update your bios to the LATEST version? and double triple check that hyperthreading option in the bios is ENABLED.

Even DISable it, save and reboot, go back into bios and ENable it, save exit and try again.

Something is fishy, and I don't think it's Linux.

Chris

----------

## Tolien

 *Taskara wrote:*   

> Dude,
> 
> your FLAGS of your cpu (from output of /proc/cpuinfo) tell me that your CPU does indeed support HT (the little "ht" flag).
> 
> When you booted to the 2004.2 Livecd, did you choose
> ...

 

Yep, only showed one CPU though  :Confused: 

 *Quote:*   

> 
> 
> Can you update your bios to the LATEST version? 

 

I would update it, but I don't have a floppy drive to put in the machine   :Embarassed:  though it did work OK for the few minutes I had Winblows installed  :Laughing: 

 *Quote:*   

> and double triple check that hyperthreading option in the bios is ENABLED.
> 
> Even DISable it, save and reboot, go back into bios and ENable it, save exit and try again.
> 
> Something is fishy, and I don't think it's Linux. 

 

Done, no joy. Though the flags still show HT when the HT is disabled in the BIOS.

----------

## c0balt

Hi,

im running on 2.6.8.1-ck5, smp/ht enabled in the kernel, and in the bios.

I remember having 2cpus shown by "cat /proc/cpuinfo".

but now its only one too.

im pretty sure though that everything is allright with HT because if im running a really demanding process (make -j1, mencoder, setiathome) 

vmstat will show me a idle of 50%, when running make -j2 its shows a idle of 0%, thus i think HT works but /proc/cpuinfo only shows one cpu

----------

## syg00

Dropped in on this thread today after installing over the last week.

Took the advice and flashed the BIOS - old level was last year, and didn't support my chip.

Updated online from windows - man, talk about living on the edge.

Gave a BIOS consistency failure on the reboot, and I get messages about no devices on either IDE master or either slave, but it fires up so what the hell.

Next time I might make a boot floppy and flash it stand-alone    :Smile: 

Windows activity monitor now shows two CPUs - beaut.

Gentoo-2.6.8-r3 only showed one in /proc/cpuinfo; as in

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 15

model           : 2

model name      : Intel(R) Pentium(R) 4 CPU 2.80GHz

Then I noticed this at the top of the screen;

bogomips        : 5521.40

...and this at the bottom.

bogomips        : 5586.94

Doh   !!!!

The processor in the message above is the processor number, not the number of processors.

Double Doh  !!!

Next time I'll use "less" rather than "cat".

Submitted to save others possible frustration - and embarrasment.

----------

## Tolien

Updated the BIOS from a CD with a clean boot image, same result, only one CPU.

Incidentally, the only CPU listed has an ID of 0, there is no Processor 1

----------

## syg00

 *Tolien wrote:*   

> Updated the BIOS from a CD with a clean boot image, same result, only one CPU.
> 
> Incidentally, the only CPU listed has an ID of 0, there is no Processor 1

 

Wasn't trying to suggest you did anything wrong - I noticed the CPU 0 on your earlier post after I had worked out what had happened to me.

As I said, *I* was the idiot, and am merely trying to fore-warn others who may search the archives.

----------

## c0balt

 *syg00 wrote:*   

> 
> 
> Doh   !!!!
> 
> The processor in the message above is the processor number, not the number of processors.
> ...

 

argh youre right O_0

cpuinfo actually shows 2cpus for me... sry my error

----------

## Tolien

 *syg00 wrote:*   

>  *Tolien wrote:*   Updated the BIOS from a CD with a clean boot image, same result, only one CPU.
> 
> Incidentally, the only CPU listed has an ID of 0, there is no Processor 1 
> 
> Wasn't trying to suggest you did anything wrong - I noticed the CPU 0 on your earlier post after I had worked out what had happened to me.
> ...

 

Heh yeah I know, was just making it clear though  :Laughing: 

----------

## Tolien

Outside an update to apache2 and lm-sensors, I don't know what the hell I just did, but the two processors are now seen   :Shocked: 

Thanks for the suggestions folks.

----------

## dustfinger

I have a Dell inspiron 5150 and I also cannot get Hyperthreading working.  One thing that concerns me is that I do not have /proc/cpuinfo.  What generates this?  

This is what I have set for Processors types and features:

 *Quote:*   

> 
> 
> x    Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon)  x x  
> 
>   x x[ ] Generic x86 support                                              x x  
> ...

 

Under Power managment Support I have:

 *Quote:*   

>  [*] ACPI Support                                      x x  
> 
>   x x               [ ]   Sleep States (EXPERIMENTAL)                     x x  
> 
>   x x               <M>   AC Adapter                                      x x  
> ...

 

When I run dmesg It states that Hyperthreading is disabled.

dustfinger.

----------

## John5788

check your bios. im sure u have hyperthreading disabled

----------

## dustfinger

John5788,

I was unable to find the option in my bios.  I am running the inspiron 5150 A31 bios.  i just found out that if I wish to use hyperthreading then I require A34 or above.  The problem is that Dell only releases its bios updates in an executable format that must be run from an MS operating system.  Blach!  Now I do have a windows partition on hdc4, however I have been unable to boot to it using lilo.  See my thread here.

OT:

Before I installed gentoo I had been running fedora core 1 and windows dual booted with the grub boot loader successfully.  I then installed gentoo in the space where fedora had been and I left my windows partition alone.  I assumed that I would have no problem booting windows from gentoo, however there is something I have missed about this all together.  I can't emerge grub because it complains that my boot partition can't be mounted.  I realize that this is off topic, but in my case I don't think I will be able to get hyperthreading enabled unless I find someway of flashing my bios and I may not beable to do that without booting into windows.

dustfinger.

----------

## X-Ryl669

To Dustfinger, simply enable proc filesystem in .config of your kernel.

It's strange you could have the whole system working without /proc...

Anyway, good luck

----------

## anjames

I have enabled SMP,SMT, ACPI,APIC (with lapic) and still I see in dmesg

Hyper-threading is disabled

I have a Toshiba 5105, which apparently has ht disabled in BIOS by default for some reason, so I have to turn it on. However, there is no Phoenix BIOS... ie I have to use some program or other to make BIOS changes. Unfortunately I removed windows years ago, and have nothing to do it with. I can't find an option to turn on ht it the toshiba-utils package either. Any ideas?

----------

