未激活所有核心,超出 NR_CPUS 限制

未激活所有核心,超出 NR_CPUS 限制

昨天,我在新系统上安装了 Lubuntu 18.04:

主板:华硕Rog Strix H370-I

CPU:I7-8700T(6核+超线程)

一切正常,但dmesg我可以看到:

root@lubuntu:~# dmesg | grep smpboot
[    0.000000] smpboot: 12 Processors exceeds NR_CPUS limit of 8
[    0.000000] smpboot: Allowing 8 CPUs, 0 hotplug CPUs
[    0.028000] smpboot: CPU0: Intel(R) Core(TM) i7-8700T CPU @ 2.40GHz (family: 0x6, model: 0x9e, stepping: 0xa)
[    0.032868] smpboot: Max logical packages: 1
[    0.032868] smpboot: Total of 8 processors activated (38400.00 BogoMIPS)

在这里您可以看到超线程功能被识别为附加核心。

问题是我只能使用 12 个“核心”中的 8 个。

如何将NR_CPUS限制从 8 增加到 12?

htoptop显示 8 个核心而不是 12 个。我不知道是否应该安装一些额外的驱动程序或固件。或者也许我应该等待新内核?

lscpu和给出的一些信息cpuinfo

root@lubuntu:~# lscpu
Architecture:        i686
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  6
Socket(s):           1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i7-8700T CPU @ 2.40GHz
Stepping:            10
CPU MHz:             800.478
CPU max MHz:         4000.0000
CPU min MHz:         800.0000
BogoMIPS:            4800.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K
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 nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves ibpb ibrs stibp dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp

root@lubuntu:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 158
model name      : Intel(R) Core(TM) i7-8700T CPU @ 2.40GHz
stepping        : 10
microcode       : 0x84
cpu MHz         : 800.123
cache size      : 12288 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 6
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
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 nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves ibpb ibrs stibp dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
bugs            : cpu_meltdown spectre_v1 spectre_v2
bogomips        : 4800.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

[处理器 1 至 7 也类似]

我也测试了其他命令。

我的 grub 行看起来像这样:

GRUB_CMDLINE_LINUX_DEFAULT="quiet maxcpus=12 nr_cpus=12 possible_cpus=12 splash"

...但它不起作用——仍然只有 8 个核心。

其他输出:

root@lubuntu:~# cat /proc/version
Linux version 4.15.0-20-generic (buildd@lgw01-amd64-033) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21-Ubuntu SMP Tue Apr 24 06:15:38 UTC 2018

编辑 grub cmd 行后:

root@lubuntu:~# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.15.0-20-generic root=UUID=10cb110b-df14-4a5f-b4de-1791af851f03 ro quiet maxcpus=12 nr_cpus=12 possible_cpus=12 splash vt.handoff=1

今天,我意识到我不小心安装了Lubuntui386代替AMD64;也许这可能是我错误行为的原因?今晚,我将安装正确的 Lubuntu 发行版并进行报告。

答案1

nr_cpus您可以使用引导加载程序命令行中的内核参数覆盖它。

... quiet nr_cpus=12 ...

答案2

解决方案:

我确实从 Lubuntu 安装了 i368 版本。安装 AMD64 版本后一切正常。

感谢您的帮助。

相关内容