首先,看看什么是超线程概念

超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高的CPU的运行效率。
超线程技术是在一颗CPU同时执行多个程序而共同分享一颗CPU内的资源,理论上要像两颗CPU一样在同一时间执行两个线程,虽然采用超线程技术能同时执行两个线程,但它并不象两个真正的CPU那样,每个CPU都具有独立的资源。当两个线程都同时需要某一个资源时,其中一个要暂时停止,并让出资源,直到这些资源闲置后才能继续。因此超线程的性能并不等于两颗CPU的性能。

其次,看看物理CPU个数,核数以及线程数的关系

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

上述公式中,逻辑CPU数即线程数

如何查看CPU物理个数

# grep 'physical id' /proc/cpuinfo | sort -u

physical id    : 0
physical id    : 1

如何查看每个物理CPU的核数

# grep 'core id' /proc/cpuinfo | sort -u | wc -l

8

如何查看总的逻辑CPU个数

# grep 'processor' /proc/cpuinfo | sort -u | wc -l

32

32/8/2=2,可见该CPU支持并已打开超线程。

如何查看CPU的型号

# dmidecode -s processor-version

Intel(R) Xeon(R) CPU E5-2658 @ 2.10GHz
Intel(R) Xeon(R) CPU E5-2658 @ 2.10GHz

关于物理CPU,核数以及超线程的区别

A core is the most basic computational unit of a processor. A processor is made up of one or more cores. Tradition processors had only one core while modern processors have multiple cores.

A core consists of an ALU, CU, and a set of registers.

A core consists of two levels of caches called L1 and L2 which is there in each core.

A processor consists of a cache that is shared by call cores called L3 cache. It is common to all cores.

A processor depending on the architecture can consist of a memory controller and an input/output controller.

Certain processor packages consist of Graphics Processing Units (GPU) as well.

A core that does not have hyper-threading can execute only one instruction at a time while a multicore processor made up of several cores can execute several instructions parallel. If a processor is made up of 4 cores that do not support hyper threading then that processor can execute 4 instructions at the same time.

A core having hyper-threading technology has redundant functional units so that they can execute multiple instructions at a time. For example, a core with 2 threads can execute 2 instructions at the same time hence a processor with 4 such cores can execute 2×4 instructions parallel. These threads are usually called logical cores and the task manager of Windows generally show the number of logical cores but not the physical cores.

转载于:https://www.cnblogs.com/xiaojianblogs/p/6209382.html

Linux上如何查看物理CPU个数,核数,线程数相关推荐

  1. 转载大神的 Linux查看物理CPU个数、核数、逻辑CPU个数

    Linux查看物理CPU个数.核数.逻辑CPU个数 CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数 查看CPU信 ...

  2. Linux系统查看物理CPU个数、CPU核数及逻辑CPU个数

    CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数 查看CPU信息(型号) [root@AAA ~]# cat /p ...

  3. 【转】Linux查看物理CPU个数、核数、逻辑CPU个数

    # 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数 # 查看物理CPU个数 cat /proc/cpuinfo| ...

  4. Linux查看物理CPU个数、核数、逻辑CPU个数

    文章系转载,便于分类和归纳,https://www.cnblogs.com/bugutian/p/6138880.html CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 ...

  5. linux非root用户查看cpu,Linux查看物理CPU个数、核数、逻辑CPU个数 – 运维那些事...

    CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数 查看CPU信息(型号) [root@AAA ~]# cat /p ...

  6. linux查看cpu个数命令,Linux怎么查看物理CPU个数

    在linux中我们对于硬件的查看只能通过命令的方式来获得了不能直接查看到了,下面学习阿拉小编给各位整理了一些Linux查看物理CPU个数.核数.逻辑CPU个数的命令供各位学习. Linux怎么查看物理 ...

  7. linux查看物理cpu,linux_查看物理cpu的核数_是否超频

    Linux 超线程 定义 超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高的CPU的运 ...

  8. linux 查看核数与线程数,Linux下查看系统CPU个数、核心数、线程数

    Linux下查看系统CPU个数.核心数.线程数 查看系统CPU个数(物理个数)cat /proc/cpuinfo |grep "physical id"|sort -u 结果如下: ...

  9. 查看linux线程个数,linux查看cpu个数,线程数及cpu型号

    1.查看CPU逻辑id grep 'physical id' /proc/cpuinfo | sort -u physical id : 0 physical id: 1 2.查看物理CPU个数 $ ...

最新文章

  1. css和JavaScript
  2. 关于button的自动刷新
  3. UA MATH563 概率论的数学基础 鞅论初步1 条件期望
  4. java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTag 错误
  5. MFC Radio Button 使用 分组 RadioButton 用法
  6. TP5:验证器的封装——5
  7. 工作191:loading不声明
  8. 【随机过程】马尔可夫链(2)
  9. python第二天 列表、元组
  10. anaconda安装torch_零基础入门PyTorch:怎样用?有哪些优势?手把手带你安装配置...
  11. 通过代理查看Myeclipse的主页
  12. Android App设计规范
  13. python字体和图片合成
  14. lamp兄弟连 mysql_LAMP兄弟连原创视频教程(笔记五--文件上传下载,mysqli对象,session,cookie,date函数)...
  15. 数据分析方法论(一)
  16. keepalived 健康检查机制说明
  17. 2019字节跳动实习面试
  18. 一图秒懂!“天使投资、VC、PE、A轮、B轮、C轮融资”的关系
  19. 流量控制理论与Sentinel
  20. Java Attach机制

热门文章

  1. 基于数据挖掘的旅游推荐APP(五):景点推荐模块
  2. MySQL查看与修改编码方式(mysql、数据库、表)
  3. ViewPager 实现页面左右滑动的简单案例1
  4. Python中常用字符串 函数-转
  5. 如何只用2GB内存从20/40/80亿个整数中找到出现次数最多的数
  6. 深入浅出,Spring 框架和 Spring Boot 的故事
  7. 学习编程的25个“坑”,你踩到了吗?
  8. 给老婆普及计算机知识
  9. Java:Random.nextInt()
  10. 6.exit _exit _Exit