Libre Mini only uses half the processor threads? How can I enable the others?

This is what htop shows me when it is running (this is running on the host/outside of any container):

In my case, the heavy usage comes from inside a container, but well… you can clearly see the CPUs being offline in htop.

I wonder why it does not use all cores, but only half of them, that is suboptimal of course. I never remember having configured anything here like the core count or assigning them to the container or so.

System

$ rpm-ostree status
State: idle
AutomaticUpdatesDriver: Zincati
  DriverState: active; periodically polling for updates (last checked Mon 2023-08-07 14:21:54 UTC)
Deployments:
● fedora:fedora/x86_64/coreos/stable
                  Version: 38.20230709.3.0 (2023-07-24T12:25:01Z)
$ podman version 4.5.1
$ lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0,2,4,6
  Off-line CPU(s) list:  1,3,5,7
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        GenuineIntel
  Model name:            Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    BIOS Model name:     Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz  CPU @ 2.0GHz
    BIOS CPU family:     12
    CPU family:          6
    Model:               142
    Thread(s) per core:  1
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            11
    CPU(s) scaling MHz:  39%
    CPU max MHz:         4600.0000
    CPU min MHz:         0.0000
    BogoMIPS:            3999.93
    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 pdpe1gb rdtscp lm constant_tsc art
                          arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1
                          sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi fl
                         expriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida ara
                         t pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0,2,4,6
Vulnerabilities:         
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Not affected
  Mds:                   Mitigation; Clear CPU buffers; SMT disabled
  Meltdown:              Not affected
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT disabled
  Retbleed:              Mitigation; IBRS
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected
[root@minipure admrugk]# lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0,2,4,6
  Off-line CPU(s) list:  1,3,5,7
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        GenuineIntel
  Model name:            Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    BIOS Model name:     Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz  CPU @ 2.0GHz
    BIOS CPU family:     12
    CPU family:          6
    Model:               142
    Thread(s) per core:  1
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            11
    CPU(s) scaling MHz:  52%
    CPU max MHz:         4600.0000
    CPU min MHz:         0.0000
    BogoMIPS:            3999.93
    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 pdpe1gb rdtscp lm constant_tsc art
                          arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1
                          sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi fl
                         expriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida ara
                         t pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0,2,4,6
Vulnerabilities:         
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Not affected
  Mds:                   Mitigation; Clear CPU buffers; SMT disabled
  Meltdown:              Not affected
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT disabled
  Retbleed:              Mitigation; IBRS
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected
[root@minipure admrugk]# htop
[root@minipure admrugk]# podman --version
podman version 4.5.1
[root@minipure admrugk]# lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0,2,4,6
  Off-line CPU(s) list:  1,3,5,7
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        GenuineIntel
  Model name:            Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    BIOS Model name:     Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz  CPU @ 2.0GHz
    BIOS CPU family:     12
    CPU family:          6
    Model:               142
    Thread(s) per core:  1
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            11
    CPU(s) scaling MHz:  39%
    CPU max MHz:         4600.0000
    CPU min MHz:         0.0000
    BogoMIPS:            3999.93
    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 pdpe1gb rdtscp lm constant_tsc art
                          arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1
                          sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi fl
                         expriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida ara
                         t pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0,2,4,6
Vulnerabilities:         
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Not affected
  Mds:                   Mitigation; Clear CPU buffers; SMT disabled
  Meltdown:              Not affected
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT disabled
  Retbleed:              Mitigation; IBRS
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected

Asked ChatGPT and it gave me a list of like 10 different reasons why that could be hmm. Some replies:

  • Check Task Manager Inside the Container is unfortunately not easily doable as neither htop, nor top nor ps are available in the container.

  • updates are all done, this system is stable

  • Hyper-Threading (HT): Your CPU doesn’t seem to support Hyper-Threading (HT) based on the Thread(s) per core: 1 information. However, some systems have BIOS settings that allow enabling/disabling HT-like features. Make sure any such settings are configured correctly.

    Yes it says that, but why. The Intel website says it has indeed 8 threads and 4 cores, so maybe that is the problem, but how to configure that (on a server…)? Can I really (only) configure that in the BIOS, if I even can do that there hmm?

$ sudo dmidecode
[…]
Handle 0x0004, DMI type 4, 42 bytes
Processor Information
	Socket Designation: Not Specified
	Type: Central Processor
	Family: Pentium Pro
	Manufacturer: GenuineIntel
	ID: EB 06 08 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 142, Stepping 11
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: 4600 MHz
	Current Speed: 2000 MHz
	Status: Unpopulated
	Upgrade: Unknown
	L1 Cache Handle: 0x0006
	L2 Cache Handle: 0x0007
	L3 Cache Handle: 0x0008
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 4
	Core Enabled: 4
	Characteristics: None
[…]

This here of course seems suspicious:

CPU(s):                  8
  On-line CPU(s) list:   0,2,4,6
  Off-line CPU(s) list:  1,3,5,7

But I also cannot enable them:

# cat /sys/devices/system/cpu/offline
1,3,5,7
# echo 1 > /sys/devices/system/cpu/cpu1/online
bash: echo: write error: Operation not permitted
# echo 1 > /sys/devices/system/cpu/cpu3/online
bash: echo: write error: Operation not permitted
# echo 1 > /sys/devices/system/cpu/cpu5/online
bash: echo: write error: Operation not permitted
# echo 1 > /sys/devices/system/cpu/cpu7/online
bash: echo: write error: Operation not permitted

(This is already root. Also writing this to an already online CPU seems to work, i.e. return no error.)


Cross-posted/asked for a specific AI application.

I don’t have a solution here, just a remark :
Seems to me all 4 cores are in use, not half of them (which would have been a major issue)
But half of the threads (identified as 8 CPUs by the system) provided by the processor are available to the system
Which is much less penalizing in performances, but ok … kind of annoying
Your subject should be :

Libre Mini only uses half the processor threads? How can I enable the others?

or

Libre Mini only uses half the CPUs? How can I enable the others?

1 Like

Try to cat /proc/cmdline, to see if there is noht or nosmt option there (I forgot which one). If there is, it means that hyperthreading has been disabled by specifying it on kernel command line.
Also, you can check status of hyperthreading by cat /sys/devices/system/cpu/smt/active.

I always thought that hyperthreading is enabled by default on Librem machines.

@MrChromebox sorry to bother you, but can you help out here?

Updated the Librem Coreboot (which was not really easy) and:suddently the issue is… drumroll
still there – but differently lol –:

As you can see now CPU threads 0-3 are in use, while 4-7 are not, which is kinda confusing…

$ lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-3
  Off-line CPU(s) list:  4-7
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    CPU family:          6
    Model:               142
    Thread(s) per core:  1
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            11
    CPU(s) scaling MHz:  30%
    CPU max MHz:         4600.0000
    CPU min MHz:         0.0000
    BogoMIPS:            3999.93
    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 pdpe1gb rdtscp lm constant_tsc art
                          arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1
                          sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnm
                         i flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida
                          arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-3
Vulnerabilities:         
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Not affected
  Mds:                   Mitigation; Clear CPU buffers; SMT disabled
  Meltdown:              Not affected
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT disabled
  Retbleed:              Mitigation; IBRS
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected
$ sudo dmidecode
[…]
Handle 0x0004, DMI type 4, 48 bytes
Processor Information
	Socket Designation: CPU0
	Type: Central Processor
	Family: Pentium Pro
	Manufacturer: GenuineIntel
	ID: EB 06 08 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 142, Stepping 11
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
	Voltage: Unknown
	External Clock: 100 MHz
	Max Speed: 4600 MHz
	Current Speed: 2000 MHz
	Status: Populated, Enabled
	Upgrade: Unknown
	L1 Cache Handle: 0x0006
	L2 Cache Handle: 0x0007
	L3 Cache Handle: 0x0008
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 4
	Core Enabled: 4
	Thread Count: 8
	Characteristics:
		Hardware Thread
		Execute Protection
		Enhanced Virtualization

Updated BIOS:

$ sudo dmidecode 
# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
Table at 0x89C10040.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: coreboot
	Version: 4.20.1-Purism-1
	Release Date: 06/12/2023
	ROM Size: 16 MB
	Characteristics:
		PCI is supported
		PC Card (PCMCIA) is supported
		BIOS is upgradeable
		Selectable boot is supported
		ACPI is supported
		Targeted content distribution is supported
	BIOS Revision: 4.20
	Firmware Revision: 0.0
[…]

…is there… uff, I’ll ask the Fedora CoreOS people, why they do that.

Seems some vulnerability mitigation (mitigations=auto,nosmt), but it disables half the threads that would be kinda a real big performance deficit…

Ah, so it’s most likely that vulnerability mitigations disabled hyperthreading.

1 Like

Yeah ChatGPT also said that if you poke them and talked rumbled a bit about general security stuff, but also explained what that parameter stands for:

The nosmt kernel parameter stands for “No Simultaneous MultiThreading” and is used to disable SMT (Hyper-Threading) on Intel processors. It is used as a mitigation for certain security vulnerabilities that can potentially affect SMT-enabled processors. Disabling SMT can provide protection against some side-channel attacks that could exploit the sharing of resources between logical cores.

However, disabling SMT comes at the cost of potentially reduced multi-threaded performance, as it essentially restricts each physical core to run only one thread at a time, regardless of whether it has multiple logical cores.

Sorta kinda, yeah. Last time I read about it, enabling HT improved performance for 30%-50%, depending on your workload. Don’t take my word for it though, I’m pulling these numbers out of my ass, basically.

For example :slight_smile: , an obvious use of your PureOS USB flash drive would be to boot it and use lscpu to see what it says.

I just did a quick test on one of my servers with a E5-2696v3 CPU that has 18 cores and hyper-threading disabled with the “nosmt” kernel option. In that test htop displays 18 cores running and another 18 in “offline” state just like you see. It’s unusual as most programs just display it as a system with 18 cores. So it looks like in your case you have hyper-threading disabled, which is a good thing IMHO, it gives less than 10% performance benefit at the best of times while increasing RAM use and making you more vulnerable to some security problems.

Given the stated aims of Purism regarding security etc having HT disabled by default seems like a good choice.

1 Like