在Linux系统中,我们可以通过查看/proc/cpuinfo文件来确认CPU是否开启了超线程(Hyper-Threading,简称HT),以下是详细的步骤:
1、打开终端
我们需要打开一个终端,在Linux系统中,我们可以使用快捷键Ctrl+Alt+T来快速打开一个新的终端。
2、查看/proc/cpuinfo文件
在终端中,我们可以使用cat命令来查看/proc/cpuinfo文件的内容,这个文件包含了关于系统CPU的详细信息,包括CPU的型号、核心数、线程数等。
在终端中输入以下命令:
cat /proc/cpuinfo | grep 'processor'
这个命令会显示出系统中所有CPU的信息,每一行代表一个CPU,其中包含了CPU的编号、型号、核心数等信息。
3、查看CPU的线程数
在/proc/cpuinfo文件中,我们可以看到每个CPU的核心数和线程数,线程数是核心数的两倍,如果一个CPU的核心数是偶数,那么它的线程数就是核心数;如果一个CPU的核心数是奇数,那么它的线程数就是核心数加一。
如果我们看到一个CPU的信息如下:
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 142 model name : Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz stepping : 12 microcode : 0x100007e9 cpu MHz : 810.000 cache size : 8192 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 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 syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx 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 epb invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt intel_pt sha_ni avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_timer avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm tpr_shadow nopl xsavepkg states epb intel_pt tsc_deadline_twister twister twolevel fastfpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 cmp_legacy svm extdpa extend check interval_min storebypass hle shadow_twisted knl invpcid mpx rdt_a intelephant fastdepend stobfuscation crc32 instruction-reordering speculative-execution retpoline worker skinny legacy mode helper hypervisor lahf_lm abm epb invpcid single pti tpr_shadow vmmcall fsgsbase tsc_adjust bmi1 avx2 bmi2 cqm asyncpf mpx rdt mpx isolcpus rcuux fixed function audio denormalise pass through amd3dcc qpi directconnect nonstop_tsc pause processor frequency idle tasktime slice register file spectre-v1 spectre-CDN mlnxpsr pku ospke shadow_vnmi flushbyasid enable avoid saturation enable preemption enable speculate enable fpu exception handler keep work at home lbr virtualize environment control forked process workaround pause process freeze process thread migration disable task priority grouping fpu fast math flags vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 syscall nx pdpe1gb rdtscp up npt constant_tsc art arch perfmon pebs bts rep good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq dtes64 monitor ds cpl vmx smx est tsc adjust bmi1 avx2 bmi2 cqm asyncpf mpx rdt mpx isolcpus rcuux fixed function audio denormalise pass through amd3dcc qpi directconnect nonstop_tsc pause processor frequency idle tasktime slice register file spectre-v1 spectre-CDN mlnxpsr pku ospke shadow_vnmi flushbyasid enable avoid saturation enable preemption enable speculate enable fpu exception handler keep work at home lbr virtualize environment control forked process workaround pause process freeze process thread migration disable task priority grouping fpu fast math flags vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/185385.html