linux的cpu信息怎么理解,理解Linux下的CPU信息:lscpu cpuinfo

通过lscpu命令,可以看到CPU的一些基本信息。如下所示,可以很清楚的看到这台服务器使用两个物理socket,每个socket上有6个core,每个core上有两个线程(超线程),所以一共有2 * 6 * 2 = 24个逻辑CPU。

Architecture: x86_64

CPU op-mode(s): 32-bit, 64-bit

Byte Order: Little Endian

CPU(s): 24

On-line CPU(s) list: 0-23

Thread(s) per core: 2

Core(s) per socket: 6

CPU socket(s): 2

NUMA node(s): 2

Vendor ID: GenuineIntel

CPU family: 6

Model: 62

Stepping: 4

CPU MHz: 2601.000

BogoMIPS: 5187.39

Virtualization: VT-x

L1d cache: 32K

L1i cache: 32K

L2 cache: 256K

L3 cache: 15360K

NUMA node0 CPU(s): 0-5,12-17

NUMA node1 CPU(s): 6-11,18-23

通过cat /proc/cpuinfo同样可以看到一些信息,这里会给socket、core和线程设置id。

同一个socket的physical id相同

cpu cores表示此socket上的core数量

如果cpu cores = siblings,表明没有开启超线程

如果cpu cores = 2 * siblings,表明开启了超线程

相同的physical id,相同的core id,但是不同的processor id,表明是同一个core上的逻辑CPU(超线程)

cpuinfo示例如下所示(原文引用已经找不到了,直接贴在这里)

Example 1: Single processor, 1 core, no Hyperthreading

Processor : 0

model name : AMD Duron(tm) processor

cache size : 64 KB

Example 2: Single processor, 1 core, Hyperthreading is enabled.

Notice how we have 2 siblings, but only 1 core. The physical CPU id is the same for both: 0.

processor : 0

model name : Intel(R) Pentium(R) 4 CPU 2.80GHz

cache size : 1024 KB

physical id : 0 # same physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

processor : 1

model name : Intel(R) Pentium(R) 4 CPU 2.80GHz

cache size : 1024 KB

physical id : 0 # same physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

Example 3. Single socket Quad Core

Notice how each processor has its own core id. The number of siblings matches the number of cores so there are no Hyperthreading siblings. Also notice the huge L2 cache - 6 MB. That makes sense though, when considering 4 cores share that L2 cache.

processor : 0

model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

cache size : 6144 KB

physical id : 0 # same physical id

siblings : 4

core id : 0 # different core id

cpu cores : 4

processor : 1

model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

cache size : 6144 KB

physical id : 0 # same physical id

siblings : 4

core id : 1 # different core id

cpu cores : 4

processor : 2

model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

cache size : 6144 KB

physical id : 0 # same physical id

siblings : 4

core id : 2 # different core id

cpu cores : 4

processor : 3

model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

cache size : 6144 KB

physical id : 0 # same physical id

siblings : 4

core id : 3 # different core id

cpu cores : 4

Example 3a. Single socket Dual Core

Again, each processor has its own core so this is a dual core system.

processor : 0

model name : Intel(R) Pentium(R) D CPU 3.00GHz

cache size : 2048 KB

physical id : 0 # same physical id

siblings : 2

core id : 0 # different core id

cpu cores : 2

processor : 1

model name : Intel(R) Pentium(R) D CPU 3.00GHz

cache size : 2048 KB

physical id : 0 # same physical id

siblings : 2

core id : 1 # different core id

cpu cores : 2

Example 4. Dual Single core CPU, Hyperthreading ENABLED

This example shows that processer 0 and 2 share the same physical CPU and 1 and 3 share the same physical CPU. The number of siblings is twice the number of cores, which is another clue that this is a system with hyperthreading enabled.

processor : 0

model name : Intel(R) Xeon(TM) CPU 3.60GHz

cache size : 1024 KB

physical id : 0 # different physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

processor : 1

model name : Intel(R) Xeon(TM) CPU 3.60GHz

cache size : 1024 KB

physical id : 3 # different physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

processor : 2

model name : Intel(R) Xeon(TM) CPU 3.60GHz

cache size : 1024 KB

physical id : 0 # different physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

processor : 3

model name : Intel(R) Xeon(TM) CPU 3.60GHz

cache size : 1024 KB

physical id : 3 # different physical id

siblings : 2

core id : 0 # same core id

cpu cores : 1

Example 5. Dual CPU Dual Core No hyperthreading

Of the 5 examples this should be the most capable system processor-wise. There are a total of 4 cores : 2 cores in 2 separate socketed physical CPUs. Each core shares the 4MB cache with its sibling core. The higher clock rate (3.0 GHz vs 2.3GHz) should offer slightly better

performance than example 3.

processor : 0

model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz

cache size : 4096 KB

physical id : 0 # different physical id

siblings : 2

core id : 0 # different core id

cpu cores : 2

processor : 1

model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz

cache size : 4096 KB

physical id : 0 # different physical id

siblings : 2

core id : 1 # different core id

cpu cores : 2

processor : 2

model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz

cache size : 4096 KB

physical id : 3 # different physical id

siblings : 2

core id : 0 # different core id

cpu cores : 2

processor : 3

model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz

cache size : 4096 KB

physical id : 3 # different physical id

siblings : 2

core id : 1 # different core id

cpu cores : 2

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/272657.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何降低SQL语句复杂度

SQL语句复杂度的优化就是在结果正确的前提下,将复杂、难以维护的SQL语句拆分成独立、易懂的SQL片段,当然也要充份利用索引,减少表描的I/O次数,尽量避免表搜索的发生。下面介绍降低SQL语句复杂度的几个建议1、动态查询语句一些应用…

提高程序员工作效率的11个技巧

“吃苦耐劳”真的是优良品质吗,与你怎么做相比,老板们应该更关心你做了什么、达到的效果。所以,效率,还是效率,希望这些实用小技巧对大家有所帮助。1、两分钟法则如果一件事可以在两分钟内完成,比如回复邮件…

tq3358 linux 串口驱动编程,TQ335x——spidev驱动的生成

kernel:CD盘的kernel3.2包环境:vmware10,ubuntu14.04修改的部分:arch/arm/mach-omap2/board-am335xevm.c文件中static struct spi_board_info am335x_spi1_slave_info[] {{.modalias "smb380",.platform_data &A…

Linux下显示ip所属位置

在linux下,要是网络出现延迟,通常我们需要分析自己到对端的服务器的网络环境 1 例:ping www.baidu.com 2 traceroute www.baidu.com 通过分析来确定大概是什么问题,可当我们去跟踪某个ip的时候不知道来源,假如每一个…

C#程序集相关的概念

程序集包含:类型元数据(描述在代码中定义的每一类型和成员,二进制形式)。程集元数据(程序集清单、版本号、名称等)、IL代码(这些都被装在exe或dll中)、资源文件。每个程序集都有自己…

linux+删除乱码的文件,linux 下删除乱码文件-乾颐堂

在linux下删除文件,遇到特殊字符是一件非常头疼的事情。1. 如果文件名带 ‘-’ 或者‘--’这样的字符删除办法为:rm -- 文件名如文件名为:-pythontab.tgz如果用普通方法去删除:1rm -pythontab.tgz结果错误:rm: invalid…

程序员如何保护自己的颈椎

我们程序员天天对着电脑,眼睛,颈椎等等,都会落下不少的职业病。来说说怎么治疗自己的颈椎病。1、颈椎病是怎么产生的形成颈椎病的核心原因是:不良生活习惯我们身体的绝大部分疾病都是来自不良的生活习惯,生活习惯不改&…

如何改变XCode的默认设置

改变bundle ID 进入 /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/Application 目录然后进入各个子目录(Navigation-based ApplicationOpenGL ES ApplicationSplit View-based ApplicationTab Bar ApplicationUtility ApplicationView-b…

linux关机时循环输出脚本,Linux关机时执行指定脚本功能实现

1.关机时执行某个脚本的具体思路(1)在文件夹/etc/init.d/下创建关机时需要执行的脚本file_name;(2)分别在文件夹/etc/rc0.d/和/etc/rc6.d/下创建该该脚本文件的链接文件K07file_name:sudo ln -s /etc/init.d/file_name /etc/rc0.d/K07file_namesudo ln -…

URI和URL及URN的区别

对于URL,大家都比较熟悉,其他两个词就比较陌生了。URI、URL和URN是识别、定位和命名互联网上的资源的标准途径。1989年Tim Berners-Lee发明了互联网(World Wide Web)。WWW被认为是全球互连的实际的和抽象的资源的集合–它按需求提供信息实体–…

Linux基础-目录与路径

今天我们一起来认识下linux中的目录与路径及操作其的一些常用命令。 说起路径就有绝对与相对之分,虽然简单,我们还是再啰嗦一下: 绝对路径,从系统的根目录/开始的目录都是相对路径,比如/usr/bin、/usr/local 相对路径…

螺旋图形Linux,Canvas 螺旋线几何图形绘制

JavaScript语言:JaveScriptBabelCoffeeScript确定window.requestAnimFrame (function() {return window.requestAnimationFrame ||window.webkitRequestAnimationFrame ||window.mozRequestAnimationFrame ||window.oRequestAnimationFrame ||window.msRequestAnim…

28家知名IT公司名称的由来

28家IT公司名称由来,你知道吗?EMC、VMware、IBM、Oracle、NetApp、Citrix、Cisco、Google、Amazon、Alibaba、UCloud、Tencent、Baidu等著名的存储、备份或云计算行业的IT公司,相信你我都是耳熟能详,但这些公司的名称是如何而来的…

编程应该用 Mac ,还是 PC ?

爱编程,不爱修电脑;爱学习,更爱运动;爱科技,也爱娱乐;爱工作,不爱加班。爱幽默、爱生活、爱浪漫、爱打拼,我是程序员,我为自己代言,关注程序员,分…

linux创建虚拟声卡,Pear BIOS 安装和配置指引

Pear BIOS 安装指引Pear BIOS是一套硬件模拟系统,操作系统可以在这套模拟硬件上运行。Pear BIOS可以让用户同时安装多套操作系统,使用时可以选择任何一套操作系统启动。在传统电脑系统上,操作系统可以识别并必须识别硬件;而在这套…

左右值

C/C语言中可以放在赋值符号左边的变量,即具有对应的可以由用户访问的存储单元,并且能够由用户去改变其值的量。左值表示存储在计算机内存的对象,而不是常量或计算的结果。或者说左值是代表一个内存地址值,并且通过这个内存地址&am…

关于 ASP.NET 内存缓存你需要知道的 10 点

缓存机制的主要目的是提高应用程序的性能。作为 ASP.NET 开发人员,你可能会意识到 ASP.NET Web 窗体以及 ASP.NET MVC 可以使用 Cache 对象缓存应用程序的数据。这通常被称为服务器端数据缓存,并且常作为框架的内置功能。虽然 ASP.NET Core 中并没有这样…

linux git删除的文件怎么还原,从Git仓库中恢复已删除的分支、文件或丢失的commit...

从Git仓库中恢复已删除的分支、文件或丢失的commit在使用Git的过程中,有时可能会有一些误操作比如:执行checkout -f 或 reset -hard 或 branch -d删除一个分支结果造成本地(远程)的分支或某些commit丢失可以通过reflog来进行恢复,前提是丢失的…

两张趣图助你理解状态码的含义~

HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码。我们可以通过查看HTTP状态码来判断服务器状态,常见的有404 、502等;但是其他不是很常见的状态码都代表什么状态呢?下面有两张有趣的图片…

java 自定义注解以及获得注解的值

1.自定义注解 import java.lang.annotation.*;Documented Target(ElementType.FIELD) Inherited Retention(RetentionPolicy.RUNTIME ) public interface MyAnno {/*** 是否能为null* return*/boolean isCanNull() default true;/*** 是否能为空字符串* return*/boolean isCanE…