【问题标题】:Processors vs cores处理器与内核
【发布时间】:2017-07-02 01:06:23
【问题描述】:

查看我的 Linux 机器(更多 /proc/cpuinfo),我看到我有 4 个处理器,每个处理器有 4 个内核。以下是 cpuinfo 的完整内容:

  processor : 0
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3464.984
  cache size    : 8192 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu 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 tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6185.83
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 1
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3462.335
  cache size    : 8192 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 nopl xtopology nonstop_tsc aperfmperf eagerfpu 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 tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.39
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 2
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3335.375
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 2
  cpu cores : 4
  apicid        : 4
  initial apicid    : 4
  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 nopl xtopology nonstop_tsc aperfmperf eagerfpu 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 tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.68
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

  processor : 3
  vendor_id : GenuineIntel
  cpu family    : 6
  model     : 60
  model name    : Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
  stepping  : 3
  microcode : 0x20
  cpu MHz       : 3367.352
  cache size    : 8192 KB
  physical id   : 0
  siblings  : 4
  core id       : 3
  cpu cores : 4
  apicid        : 6
  initial apicid    : 6
  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 nopl xtopology nonstop_tsc aperfmperf eagerfpu 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 tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
  bugs      :
  bogomips  : 6189.74
  clflush size  : 64
  cache_alignment   : 64
  address sizes : 39 bits physical, 48 bits virtual
  power management:

我知道核心是一个处理单元,每个处理器包含 4 个这样的核心(例如,this 问题很好地解决了这个问题),但我对它们的实际使用和访问方式感到非常困惑。

在我使用过的所有并行处理工具中(主要是在 R 中),我最多可以访问 4 个处理器/内核(称为处理器或内核,具体取决于包的语言)。此外,在我的系统监视器中,我看到 4 个处理器,当其中一个处于活动状态时,它是完全活动的。我从来没有看到部分活动表明我可以访问除一个完整处理器(即该处理器内的 4 个内核)之外的任何东西。但是,拥有 4 个处理器和 4 个内核意味着我实际上可以一次运行 16 个线程/进程。

我错过了什么?我可以单独访问这些内核中的每一个,还是给定处理器的 4 个内核绑定到该处理器的活动?

编辑:我刚刚检查了我们服务器机房中的另一台机器,发现上面发布的片段重复了 40 次(!!!),所以我的处理器从 0 到 39。每个都列出了 10 个内核。我不应该能够运行 400 个并行作业而不是 40 个吗?

EDIT2:仔细研究服务器,我看到每个处理器有 40 个输出块。这里没有发布整个内容,而是一个简短的版本,对我所看到的内容进行了一些解释:

processor:  0  (this ranges from 0 to 40)
physical id:  0:  (ranges from 0 to 1, with 20 of each - this is telling me 2 physical Xeon processors present)
siblings:  20  (same for all - a bit confused here as Xeon is a 10 core processor)
core id:  (ranges from 0 to 12, but missing 5,6,7 - a total of 10 ids, but where are 5,6, and 7?  Also, there are 4 of each core id - 4 0s, 4 1s, etc.)
cpu cores:  10  (all have the same here, which makes sense but seems inconsistent with siblings)

此服务器上处理器的型号名称是 Xeon CPU E5-2650 v3,如果有帮助的话。这是它的网页:https://ark.intel.com/products/81705/Intel-Xeon-Processor-E5-2650-v3-25M-Cache-2_30-GHz

【问题讨论】:

    标签: parallel-processing processor


    【解决方案1】:

    根据您拥有的内核,每个单独的内核都被标识为一个处理器。

    这可能是您正在寻找的确切问题,并且有详细的解释: https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo

    【讨论】:

    • 该链接非常有用!谢谢你。为了确保我理解,我在关于我们服务器的问题中添加了一些内容。任何进一步的 cmets 都非常感谢。
    • 您正在查看的系统有 2 个物理处理器。每个处理器有 10 个物理内核,它们是超线程内核。这意味着每个物理内核可以运行两个线程。这意味着每个物理处理器有 20 个逻辑内核。因此,您会看到 40 个处理器。 2 个物理处理器 * 每个处理器 10 个内核 * 每个内核 2 个线程(超线程)。
    • 谢谢!!这非常有帮助。
    【解决方案2】:

    您有 1 个 4 核处理器。

    具有超过 1 个处理器的系统非常少见,除了超级计算机等。

    【讨论】:

    • 实际上,我发布的片段只是 4 个处理器之一。我将相同的部分(加上其他信息)重复了 3 次。而且,是的,我知道每个处理器有 4 个内核,但为什么我似乎只能从任何并行软件访问 4 个内核/处理器。我不应该访问 16 吗?
    • 不,相同的信息重复 4 次并不意味着你有 4 个处理器。该信息在每个核心重复一次。所以,你仍然只有 1 个处理器。
    • PS:如果您仔细查看信息,您会注意到有一个名为 core id 的字段从 0 到 3。那是因为您对每个核心都有单独的信息。
    • 我认为我们的沟通中缺少一些东西。我在上面添加了更多内容,希望对您有所帮助。请注意,有四个块具有唯一的处理器:和核心 id:标识符。这些块中的每一个作为杯芯:4
    猜你喜欢
    • 2014-12-17
    • 1970-01-01
    • 2016-05-14
    • 2015-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 2015-05-17
    相关资源
    最近更新 更多