# No SMP :(

## curmudgeon

Pentium 4 with hyperthreading:

```
# dog /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 2

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

stepping        : 9

cpu MHz         : 2600.000

cache size      : 512 KB

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 up cid xtpr

bogomips        : 5204.50

clflush size    : 64
```

But (as seen above), the kernel only sees one processor.

The relevant  part of /usr/src/linux-2.6.22-gentoo-r2/.config:

```
#

# Processor type and features

#

# CONFIG_TICK_ONESHOT is not set

# CONFIG_NO_HZ is not set

# CONFIG_HIGH_RES_TIMERS is not set

CONFIG_SMP=y

CONFIG_X86_PC=y

# CONFIG_X86_ELAN is not set

# CONFIG_X86_VOYAGER is not set

# CONFIG_X86_NUMAQ is not set

# CONFIG_X86_SUMMIT is not set

# CONFIG_X86_BIGSMP is not set

# CONFIG_X86_VISWS is not set

# CONFIG_X86_GENERICARCH is not set

# CONFIG_X86_ES7000 is not set

# CONFIG_PARAVIRT is not set

# CONFIG_M386 is not set

# CONFIG_M486 is not set

# CONFIG_M586 is not set

# CONFIG_M586TSC is not set

# CONFIG_M586MMX is not set

# CONFIG_M686 is not set

# CONFIG_MPENTIUMII is not set

# CONFIG_MPENTIUMIII is not set

# CONFIG_MPENTIUMM is not set

# CONFIG_MCORE2 is not set

CONFIG_MPENTIUM4=y

# CONFIG_MK6 is not set

# CONFIG_MK7 is not set

# CONFIG_MK8 is not set

# CONFIG_MCRUSOE is not set

# CONFIG_MEFFICEON is not set

# CONFIG_MWINCHIPC6 is not set

# CONFIG_MWINCHIP2 is not set

# CONFIG_MWINCHIP3D is not set

# CONFIG_MGEODEGX1 is not set

# CONFIG_MGEODE_LX is not set

# CONFIG_MCYRIXIII is not set

# CONFIG_MVIAC3_2 is not set

# CONFIG_MVIAC7 is not set

# CONFIG_X86_GENERIC is not set

CONFIG_X86_CMPXCHG=y

CONFIG_X86_L1_CACHE_SHIFT=7

CONFIG_X86_XADD=y

CONFIG_RWSEM_XCHGADD_ALGORITHM=y

# CONFIG_ARCH_HAS_ILOG2_U32 is not set

# CONFIG_ARCH_HAS_ILOG2_U64 is not set

CONFIG_GENERIC_CALIBRATE_DELAY=y

CONFIG_X86_WP_WORKS_OK=y

CONFIG_X86_INVLPG=y

CONFIG_X86_BSWAP=y

CONFIG_X86_POPAD_OK=y

CONFIG_X86_GOOD_APIC=y

CONFIG_X86_INTEL_USERCOPY=y

CONFIG_X86_USE_PPRO_CHECKSUM=y

CONFIG_X86_TSC=y

CONFIG_X86_CMOV=y

CONFIG_X86_MINIMUM_CPU_MODEL=4

# CONFIG_HPET_TIMER is not set

CONFIG_NR_CPUS=2

CONFIG_SCHED_SMT=y

# CONFIG_SCHED_MC is not set

# CONFIG_PREEMPT_NONE is not set

# CONFIG_PREEMPT_VOLUNTARY is not set

CONFIG_PREEMPT=y

CONFIG_PREEMPT_BKL=y

CONFIG_X86_LOCAL_APIC=y

CONFIG_X86_IO_APIC=y

CONFIG_X86_MCE=y

# CONFIG_X86_MCE_NONFATAL is not set

# CONFIG_X86_MCE_P4THERMAL is not set

CONFIG_VM86=y

# CONFIG_TOSHIBA is not set

# CONFIG_I8K is not set

# CONFIG_X86_REBOOTFIXUPS is not set

# CONFIG_MICROCODE is not set

CONFIG_X86_MSR=y

# CONFIG_X86_CPUID is not set
```

What did I do wrong?

----------

## dmpogo

And why do you think Pentium4 has multiple cores ?

----------

## curmudgeon

 *dmpogo wrote:*   

> And why do you think Pentium4 has multiple cores ?

 

It doesn't, but it has hyperthreading (note the "ht" in the flags), which lets it act like two processors. The kernels in all of my other Pentium 4s (single processor machines) see two processors, like this:

```
 dog /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 3

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

stepping        : 4

cpu MHz         : 3000.000

cache size      : 1024 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

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 constant_tsc pni monitor ds_cpl cid xtpr

bogomips        : 6005.73

clflush size    : 64

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 15

model           : 3

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

stepping        : 4

cpu MHz         : 3000.000

cache size      : 1024 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

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 constant_tsc pni monitor ds_cpl cid xtpr

bogomips        : 6001.47

clflush size    : 64
```

RTFM: http://gentoo.org/doc/en/kernel-config.xml

 *Quote:*   

> Many of Intel's CPUs support a technology which they call hyper-threading, which is where the CPU is actually viewed by the system as two logical processors.

 

I do have the kernel configuration options set according to that guide.

----------

## SeeksTheMoon

emerge microcode-ctl and enable the microcode option in your kernel. Maybe it's a bug. I need to use microcode because my mobile CPU can use more speedstep values afterwards.

Oh, btw: I guess HT is not disabled in your BIOS?

----------

## curmudgeon

 *SeeksTheMoon wrote:*   

> emerge microcode-ctl and enable the microcode option in your kernel. Maybe it's a bug. I need to use microcode because my mobile CPU can use more speedstep values afterwards.

 

I will have to look at that a little later. I can't recompile and reboot that machine right now

 *SeeksTheMoon wrote:*   

> Oh, btw: I guess HT is not disabled in your BIOS?

 

I did look in the BIOS, and saw nothing about it.

----------

## pa1983

HT may boost performance whit about 5% tops on heavy loaded servers and things like that. On a desktop its close to 0% in most cases. Its also in theory a security risk, at least on Pentium 4. I cant really see any big point in having on on any way.

Just my 5 cents.

----------

## eccerr0r

https://forums.gentoo.org/viewtopic-t-580679-highlight-.html

https://forums.gentoo.org/viewtopic-t-578089-highlight-.html

Not all P4s have it enabled despite all P4s having the CPUFLAG for HT.

BTW, I think that "security hole risk" is pretty much the same for any multithreaded CPU with shared memories, people have been claiming it to manifest on multicore and SMP systems in general.

It depends on the applications you're running whether you'll see an overall throughput speedup through SMT.  For single threaded apps you'll likely see a very slight slowdown, but if you choose your threads properly you'll most definitely see an improvement.

----------

## curmudgeon

Thank you for the explanation eccerr0r.

----------

## zeek

Do you have ACPI enabled in power management?  Without that in newer kernels they wont see the extra ...uh hypercore.

I usually enable processor and thermal zone while I'm at it.

----------

