AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 740689
Accepted
Mark K
Mark K
Asked: 2023-03-23 15:33:39 +0800 CST2023-03-23 15:33:39 +0800 CST 2023-03-23 15:33:39 +0800 CST

为什么传感器输出的CPU核心数不连续?

  • 772

命令中核心编号为0,4,8,.......39 sensors。

为什么不是 0,1,2,3,4.......?

foo@foo-linux:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +73.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:        +46.0°C  (high = +80.0°C, crit = +100.0°C)
Core 4:        +50.0°C  (high = +80.0°C, crit = +100.0°C)
Core 8:        +52.0°C  (high = +80.0°C, crit = +100.0°C)
Core 12:       +47.0°C  (high = +80.0°C, crit = +100.0°C)
Core 16:       +73.0°C  (high = +80.0°C, crit = +100.0°C)
Core 20:       +50.0°C  (high = +80.0°C, crit = +100.0°C)
Core 24:       +58.0°C  (high = +80.0°C, crit = +100.0°C)
Core 28:       +52.0°C  (high = +80.0°C, crit = +100.0°C)
Core 36:       +48.0°C  (high = +80.0°C, crit = +100.0°C)
Core 37:       +48.0°C  (high = +80.0°C, crit = +100.0°C)
Core 38:       +48.0°C  (high = +80.0°C, crit = +100.0°C)
Core 39:       +48.0°C  (high = +80.0°C, crit = +100.0°C)

再次更新

这是第 12 代 Intel(R) Core(TM) i7-12700

这是一台 PC,而不是服务器,只有一个 CPU 插槽。

更新

foo@foo-linux:~$ cat /proc/cpuinfo | grep -i apicid
apicid      : 0
initial apicid  : 0
apicid      : 1
initial apicid  : 1
apicid      : 8
initial apicid  : 8
apicid      : 9
initial apicid  : 9
apicid      : 16
initial apicid  : 16
apicid      : 17
initial apicid  : 17
apicid      : 24
initial apicid  : 24
apicid      : 25
initial apicid  : 25
apicid      : 32
initial apicid  : 32
apicid      : 33
initial apicid  : 33
apicid      : 40
initial apicid  : 40
apicid      : 41
initial apicid  : 41
apicid      : 48
initial apicid  : 48
apicid      : 49
initial apicid  : 49
apicid      : 56
initial apicid  : 56
apicid      : 57
initial apicid  : 57
apicid      : 72
initial apicid  : 72
apicid      : 74
initial apicid  : 74
apicid      : 76
initial apicid  : 76
apicid      : 78
initial apicid  : 78
cpu
  • 2 2 个回答
  • 52 Views

2 个回答

  • Voted
  1. Marcus Müller
    2023-03-23T15:57:15+08:002023-03-23T15:57:15+08:00

    这个答案可能不会让您感到惊讶,但是:因为那是写的方式sensors。

    sensors只是sensors_get_detected_chips用来遍历所有传感器——而不是通过 CPU 内核。传感器的这些顺序是在相关总线上“检测到的”(因此,主要是 I²C/SMBUS,仿真 ISA),而不是 CPU 内核(相对任意)编号的顺序。

    • 1
  2. Best Answer
    telcoM
    2023-03-23T19:44:17+08:002023-03-23T19:44:17+08:00

    核心编号来自驱动模块中cpu_core_id的变量。在其源代码中,是这样描述的:struct temp_datacoretempcpu_core_id

    * @cpu_core_id: The CPU Core from which temperature values should be read
    *       This value is passed as "id" field to rdmsr/wrmsr functions.
    

    和是在指定处理器中读取/写入特定于模型的寄存器的机器代码指令rdmsr。wrmsr该coretemp模块通过arch/x86/lib/msr-smp.c中定义的函数使用这些指令。这些函数只是按原样传递 CPU/核心 ID 字段,因此显示的 ID 正是您的主板和 CPU 使用的 ID。

    如果您的主板有 4 个 CPU 插槽,但只安装了一个插槽,则固件可能已配置为依次为每个插槽分配 ID 号,因此属于空插槽的 ID 将被闲置。但在您的情况下,末尾有一系列四个连续的核心 ID (36 .. 39),因此这可能有所不同。

    也许这是一个具有两种类型内核的处理器,一种类型的内核在编号上有间隙(0、4、8 ...),而另一种没有间隙(36 .. 39)?

    要了解更多信息,有必要确定确切的处理器型号(例如使用 的输出lscpu | head -14),然后研究该处理器型号的技术文档以了解如何在硬件/微代码级别分配核心 ID。

    如果主板/固件不能指定核心 ID 的分配,那么可以猜测 CPU 制造商可能正在计划下一代处理器,其中包含更多的第一类核心(即编号中的空白部分或完全填补) . 但这只是一个猜测,制造商的计划无论如何都可能改变......

    • 1

相关问题

  • 我有多少 CPU,我应该提交多少作业?

  • 在 Linux 中设置 CPU 内核利用率限制

  • CPU 怎么知道有 IO 挂起?

  • 机器总运行时间

  • 为什么 OpenVZ 容器中的 nproc 和 nproc --all 的 CPU 计数不同?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve