zoukankan      html  css  js  c++  java
  • linux查看CPU内核信息

    linux查看CPU内核信息命令:cat /proc/cpuinfo

    processor    : 0
    vendor_id    : GenuineIntel
    cpu family    : 6
    model        : 62
    model name    : Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
    stepping    : 4
    cpu MHz        : 2493.953
    cache size    : 10240 KB
    physical id    : 0
    siblings    : 4
    core id        : 0
    cpu cores    : 4
    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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
    bogomips    : 4987.90
    clflush size    : 64
    cache_alignment    : 64
    address sizes    : 46 bits physical, 48 bits virtual
    power management:
    
    processor    : 1
    vendor_id    : GenuineIntel
    cpu family    : 6
    model        : 62
    model name    : Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
    stepping    : 4
    cpu MHz        : 2493.953
    cache size    : 10240 KB
    physical id    : 0
    siblings    : 4
    core id        : 1
    cpu cores    : 4
    apicid        : 2
    initial apicid    : 2
    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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
    bogomips    : 4987.90
    clflush size    : 64
    cache_alignment    : 64
    address sizes    : 46 bits physical, 48 bits virtual
    power management:
    ......

    属性说明:

    physical id:物理CPU的唯一标识ID
    core id:每个物理CPU中内核的唯一标识ID
    processor:当前逻辑CPU的唯一标识
    siblings:同一个物理CPU中逻辑CPU数量
    cpu cores:同一个物理CPU中内核数量
    #如果有两个逻辑CPU具有相同的”core id”,那么超线程是打开的(所有带有相同core id的逻辑CPU均位于同一个处理器内核上)
    model name:CPU型号

    # 总核数 = 物理CPU个数 * 每颗物理CPU的核数 
    # 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数

    简单命令:
    # 查看物理CPU个数
    cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
    
    # 查看每个物理CPU中core的个数(即核数)
    cat /proc/cpuinfo| grep "cpu cores"| uniq
    
    # 查看逻辑CPU的个数
    cat /proc/cpuinfo| grep "processor"| wc -l


     
  • 相关阅读:
    程序猿初出茅庐之一:学习方法
    Winform实现鼠标可穿透的窗体镂空效果
    HashMap源码分析(上)
    Java Integer常量池——IntegerCache内部类
    find the Nth highest salary(寻找第N高薪水)
    分布式理论:深入浅出Paxos算法
    smash:一个类unix内核
    【官网翻译】如何在VSCode中使用代码片段功能(snippets)?
    JavaScript与魔数检测
    给你一个团队,你能怎么管-读后感-凝聚力和执行力(1)
  • 原文地址:https://www.cnblogs.com/mr-long/p/5841416.html
Copyright © 2011-2022 走看看