# Hyperthreading - is it enabled?

## dolphinaura

Currently, my cpuinfo shows as follows

```
processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 23

model name      : Intel(R) Core(TM)2 Duo CPU     T6500  @ 2.10GHz

stepping        : 10

cpu MHz         : 2100.000

cache size      : 2048 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 2

apicid          : 0

initial apicid  : 0

fpu             : yes

fpu_exception   : yes

cpuid level     : 13

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 syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts

bogomips        : 4188.93

clflush size    : 64

cache_alignment : 64

address sizes   : 36 bits physical, 48 bits virtual

power management:

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 6

model           : 23

model name      : Intel(R) Core(TM)2 Duo CPU     T6500  @ 2.10GHz

stepping        : 10

cpu MHz         : 2100.000

cache size      : 2048 KB

physical id     : 0

siblings        : 2

core id         : 1

cpu cores       : 2

apicid          : 1

initial apicid  : 1

fpu             : yes

fpu_exception   : yes

cpuid level     : 13

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 syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts

bogomips        : 4189.28

clflush size    : 64

cache_alignment : 64

address sizes   : 36 bits physical, 48 bits virtual

power management:

```

seeing as I have the ht flag, shouldn't htop show 4 cpus?

----------

## avx

Have you configured your kernel accordingly? For me, htop is showing 8 CPUs on an i7-920, thus it's correct here.

----------

## dolphinaura

It says in menuconfig that I have SMT (hyperthreading) enabled, so I would guess that its enabled.

anyways, heres a copy of the cpu section in  .config

```

#

# Processor type and features

#

CONFIG_TICK_ONESHOT=y

CONFIG_NO_HZ=y

CONFIG_HIGH_RES_TIMERS=y

CONFIG_GENERIC_CLOCKEVENTS_BUILD=y

CONFIG_SMP=y

CONFIG_SPARSE_IRQ=y

CONFIG_NUMA_IRQ_DESC=y

CONFIG_X86_MPPARSE=y

CONFIG_X86_EXTENDED_PLATFORM=y

CONFIG_X86_VSMP=y

CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y

CONFIG_SCHED_OMIT_FRAME_POINTER=y

CONFIG_PARAVIRT_GUEST=y

# CONFIG_XEN is not set

# CONFIG_KVM_CLOCK is not set

# CONFIG_KVM_GUEST is not set

CONFIG_PARAVIRT=y

# CONFIG_PARAVIRT_SPINLOCKS is not set

# CONFIG_PARAVIRT_DEBUG is not set

CONFIG_NO_BOOTMEM=y

CONFIG_MEMTEST=y

# CONFIG_MK8 is not set

# CONFIG_MPSC is not set

CONFIG_MCORE2=y

# CONFIG_MATOM is not set

# CONFIG_GENERIC_CPU is not set

CONFIG_X86_CPU=y

CONFIG_X86_INTERNODE_CACHE_SHIFT=12

CONFIG_X86_CMPXCHG=y

CONFIG_X86_L1_CACHE_SHIFT=6

CONFIG_X86_XADD=y

CONFIG_X86_WP_WORKS_OK=y

CONFIG_X86_INTEL_USERCOPY=y

CONFIG_X86_USE_PPRO_CHECKSUM=y

CONFIG_X86_P6_NOP=y

CONFIG_X86_TSC=y

CONFIG_X86_CMPXCHG64=y

CONFIG_X86_CMOV=y

CONFIG_X86_MINIMUM_CPU_FAMILY=64

CONFIG_X86_DEBUGCTLMSR=y

CONFIG_CPU_SUP_INTEL=y

CONFIG_CPU_SUP_AMD=y

CONFIG_CPU_SUP_CENTAUR=y

CONFIG_HPET_TIMER=y

CONFIG_HPET_EMULATE_RTC=y

CONFIG_DMI=y

CONFIG_GART_IOMMU=y

CONFIG_CALGARY_IOMMU=y

CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y

CONFIG_AMD_IOMMU=y

CONFIG_AMD_IOMMU_STATS=y

CONFIG_SWIOTLB=y

CONFIG_IOMMU_HELPER=y

CONFIG_IOMMU_API=y

# CONFIG_MAXSMP is not set

CONFIG_NR_CPUS=64

CONFIG_SCHED_SMT=y

CONFIG_SCHED_MC=y

# CONFIG_PREEMPT_NONE is not set

CONFIG_PREEMPT_VOLUNTARY=y

# CONFIG_PREEMPT is not set

CONFIG_X86_LOCAL_APIC=y

CONFIG_X86_IO_APIC=y

CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y

CONFIG_X86_MCE=y

CONFIG_X86_MCE_INTEL=y

# CONFIG_X86_MCE_AMD is not set

CONFIG_X86_MCE_THRESHOLD=y

# CONFIG_X86_MCE_INJECT is not set

CONFIG_X86_THERMAL_VECTOR=y

CONFIG_I8K=y

CONFIG_MICROCODE=y

CONFIG_MICROCODE_INTEL=y

# CONFIG_MICROCODE_AMD is not set

CONFIG_MICROCODE_OLD_INTERFACE=y

CONFIG_X86_MSR=y

CONFIG_X86_CPUID=y

CONFIG_ARCH_PHYS_ADDR_T_64BIT=y

CONFIG_DIRECT_GBPAGES=y

CONFIG_NUMA=y

CONFIG_K8_NUMA=y

CONFIG_X86_64_ACPI_NUMA=y

CONFIG_NODES_SPAN_OTHER_NODES=y

# CONFIG_NUMA_EMU is not set

CONFIG_NODES_SHIFT=6

CONFIG_ARCH_PROC_KCORE_TEXT=y

CONFIG_ARCH_SPARSEMEM_DEFAULT=y

CONFIG_ARCH_SPARSEMEM_ENABLE=y

CONFIG_ARCH_SELECT_MEMORY_MODEL=y

CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000

CONFIG_SELECT_MEMORY_MODEL=y

CONFIG_SPARSEMEM_MANUAL=y

CONFIG_SPARSEMEM=y

CONFIG_NEED_MULTIPLE_NODES=y

CONFIG_HAVE_MEMORY_PRESENT=y

CONFIG_SPARSEMEM_EXTREME=y

CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y

CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y

CONFIG_SPARSEMEM_VMEMMAP=y

# CONFIG_MEMORY_HOTPLUG is not set

CONFIG_PAGEFLAGS_EXTENDED=y

CONFIG_SPLIT_PTLOCK_CPUS=4

CONFIG_COMPACTION=y

CONFIG_MIGRATION=y

CONFIG_PHYS_ADDR_T_64BIT=y

CONFIG_ZONE_DMA_FLAG=1

CONFIG_BOUNCE=y

CONFIG_VIRT_TO_BUS=y

CONFIG_MMU_NOTIFIER=y

# CONFIG_KSM is not set

CONFIG_DEFAULT_MMAP_MIN_ADDR=4096

CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y

# CONFIG_MEMORY_FAILURE is not set

CONFIG_X86_CHECK_BIOS_CORRUPTION=y

CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y

CONFIG_X86_RESERVE_LOW_64K=y

CONFIG_MTRR=y

# CONFIG_MTRR_SANITIZER is not set

CONFIG_X86_PAT=y

CONFIG_ARCH_USES_PG_UNCACHED=y

CONFIG_EFI=y

CONFIG_SECCOMP=y

# CONFIG_CC_STACKPROTECTOR is not set

# CONFIG_HZ_100 is not set

# CONFIG_HZ_250 is not set

# CONFIG_HZ_300 is not set

CONFIG_HZ_1000=y

CONFIG_HZ=1000

CONFIG_SCHED_HRTICK=y

CONFIG_KEXEC=y

CONFIG_CRASH_DUMP=y

# CONFIG_KEXEC_JUMP is not set

CONFIG_PHYSICAL_START=0x1000000

CONFIG_RELOCATABLE=y

CONFIG_PHYSICAL_ALIGN=0x1000000

CONFIG_HOTPLUG_CPU=y

# CONFIG_COMPAT_VDSO is not set

CONFIG_CMDLINE_BOOL=y

CONFIG_CMDLINE=""

# CONFIG_CMDLINE_OVERRIDE is not set

CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y

CONFIG_USE_PERCPU_NUMA_NODE_ID=y 

```

----------

## EatMeerkats

The T6500 doesn't support HyperThreading, so what you are seeing is correct.

----------

## dolphinaura

 *EatMeerkats wrote:*   

> The T6500 doesn't support HyperThreading, so what you are seeing is correct.

 

hmm... weird. I actually wonder why my CPU has the HT flag then.

----------

## Hu

 *dolphinaura wrote:*   

> It says in menuconfig that I have SMT (hyperthreading) enabled, so I would guess that its enabled.

 That is a scheduler feature to enable it to do a better job on SMT machines.

 *dolphinaura wrote:*   

> anyways, heres a copy of the cpu section in  .config
> 
> ```
> CONFIG_PARAVIRT_GUEST=y
> 
> ...

 Are you actually running as a paravirtualized guest?

 *dolphinaura wrote:*   

> 
> 
> ```
> CONFIG_NR_CPUS=64
> ```
> ...

 This seems excessive for a system using a Core2 Duo.

----------

## depontius

I recently was given a Thinkpad W510 at work, with a Core-I7.  By default SMT is enabled, and I've made sure that the kernel features are properly selected.  But it registers as 8 CPUs, which seems to be to be a trifle optimistic.  From what I've read on Phoronix, usually SMT makes little difference, occasionally it helps or hurts a little, and every now and then it kind of bombs.

So I'm really not sure if I shouldn't be just turning it off in BIOS, and give myself 4 real CPUs.  I haven't done anything yet because the machine is in the default state, I've never gotten around to making the change, and the impetus hasn't seemed overwhelming one way or another.  Anyone here have any experience, one way or another?

----------

## Gusar

 *depontius wrote:*   

> Anyone here have any experience, one way or another?

 

For Atom processors, hypetrthreading is it's saving grace. It's only because of hyperthreading that the thing can decode 720p video (but even that just barely). Also, on my Core i3, hyperthreading does reduce compile times. Don't have exact numbers available for you, but I could maybe do some tests. x264 encoding also benefits from HT.

----------

## gerard27

This post made me curious.

I have a box with an AMD Phenom II X4 925 processor.

Gigabyte  GA-790XT-USB3 mb.

It also has the ht flag.

The help in menuconfig says SMT is for P4 processors so I did not enable it.

Would enabling it make any difference?

Gerard.

----------

## gerard27

I recompiled my kernel (2.6.34-r12) with SMT enabled.

No difference:htop still shows 4 processors.

Gerard.

----------

## gentoo_ram

For the O.P., the T6500 does not support hyper-threading according to Intel.  It just supports 2 threads which matches the number of cores.  Compare that to a Core i7-920 which has 4 cores and supports 8 threads.

T6500: http://ark.intel.com/Product.aspx?id=39311

i7-920: http://ark.intel.com/Product.aspx?id=37147

----------

## gerard27

In the mean time I checked on hyperthreading but afaik it's not for AMD processors.

Gerard.

----------

## graysky

I would disable it in the .config if the chip doesn't supportive it:

 *Quote:*   

> SMT scheduler support improves the CPU scheduler's decision making when dealing with Intel Pentium 4 chips with HyperThreading at a cost of slightly increased overhead in some places. If unsure say N here.

 

----------

