cpu与内核的关系

cpu与内核的关系

What I have always understood is that a CPU can have multiple cores, but a core can only belong to one CPU. The information I found on the Internet also shows this. But when I use lscpu --extend, it shows that multiple CPUs belong to a core? The following shows the data I used lscpu --extend on my linux server. Does this show that both cpu0 and cpu24 belong to core 0?

    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
    0   0    0      0    0:0:0:0       是     2900.0000 1200.0000
    1   1    1      1    1:1:1:1       是     2900.0000 1200.0000
    2   0    0      2    2:2:2:0       是     2900.0000 1200.0000
    3   1    1      3    3:3:3:1       是     2900.0000 1200.0000
    4   0    0      4    4:4:4:0       是     2900.0000 1200.0000
    5   1    1      5    5:5:5:1       是     2900.0000 1200.0000
    6   0    0      6    6:6:6:0       是     2900.0000 1200.0000
    7   1    1      7    7:7:7:1       是     2900.0000 1200.0000
    8   0    0      8    8:8:8:0       是     2900.0000 1200.0000
    9   1    1      9    9:9:9:1       是     2900.0000 1200.0000
    10  0    0      10   10:10:10:0    是     2900.0000 1200.0000
    11  1    1      11   11:11:11:1    是     2900.0000 1200.0000
    12  0    0      12   12:12:12:0    是     2900.0000 1200.0000
    13  1    1      13   13:13:13:1    是     2900.0000 1200.0000
    14  0    0      14   14:14:14:0    是     2900.0000 1200.0000
    15  1    1      15   15:15:15:1    是     2900.0000 1200.0000
    16  0    0      16   16:16:16:0    是     2900.0000 1200.0000
    17  1    1      17   17:17:17:1    是     2900.0000 1200.0000
    18  0    0      18   18:18:18:0    是     2900.0000 1200.0000
    19  1    1      19   19:19:19:1    是     2900.0000 1200.0000
    20  0    0      20   20:20:20:0    是     2900.0000 1200.0000
    21  1    1      21   21:21:21:1    是     2900.0000 1200.0000
    22  0    0      22   22:22:22:0    是     2900.0000 1200.0000
    23  1    1      23   23:23:23:1    是     2900.0000 1200.0000
    24  0    0      0    0:0:0:0       是     2900.0000 1200.0000
    25  1    1      1    1:1:1:1       是     2900.0000 1200.0000
    26  0    0      2    2:2:2:0       是     2900.0000 1200.0000
    27  1    1      3    3:3:3:1       是     2900.0000 1200.0000
    28  0    0      4    4:4:4:0       是     2900.0000 1200.0000
    29  1    1      5    5:5:5:1       是     2900.0000 1200.0000
    30  0    0      6    6:6:6:0       是     2900.0000 1200.0000
    31  1    1      7    7:7:7:1       是     2900.0000 1200.0000
    32  0    0      8    8:8:8:0       是     2900.0000 1200.0000
    33  1    1      9    9:9:9:1       是     2900.0000 1200.0000
    34  0    0      10   10:10:10:0    是     2900.0000 1200.0000
    35  1    1      11   11:11:11:1    是     2900.0000 1200.0000
    36  0    0      12   12:12:12:0    是     2900.0000 1200.0000
    37  1    1      13   13:13:13:1    是     2900.0000 1200.0000
    38  0    0      14   14:14:14:0    是     2900.0000 1200.0000
    39  1    1      15   15:15:15:1    是     2900.0000 1200.0000
    40  0    0      16   16:16:16:0    是     2900.0000 1200.0000
    41  1    1      17   17:17:17:1    是     2900.0000 1200.0000
    42  0    0      18   18:18:18:0    是     2900.0000 1200.0000
    43  1    1      19   19:19:19:1    是     2900.0000 1200.0000
    44  0    0      20   20:20:20:0    是     2900.0000 1200.0000
    45  1    1      21   21:21:21:1    是     2900.0000 1200.0000
    46  0    0      22   22:22:22:0    是     2900.0000 1200.0000
    47  1    1      23   23:23:23:1    是     2900.0000 1200.0000

答案1

Some of the terminology is strange but yes.

I think that in this output Socket means CPU. Core means core of a CPU (Socket). So there can be a core 0 of socket 0 and a core 0 of socket 1.

Node is a numa node, so you have two devices networked together as a cluster.

And CPU means distinct core: one for socket 0 core 0 and another for socket 1 core 0.

However I think you are correct. CPU n and n+24 seem the same. On my lap top I get

0   0    0      0    0:0:0:0       yes    2000.0000 500.0000
1   0    0      1    1:1:1:0       yes    2000.0000 500.0000
2   0    0      0    0:0:0:0       yes    2000.0000 500.0000
3   0    0      1    1:1:1:0       yes    2000.0000 500.0000

类似的结果。我知道这个设备有 1 个插槽(CPU)和 2 个核心,但有 4 个超线程。因此我认为每个CPU都是一个超线程(不是真正的独立核心)。

输出来自lscpu

...
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
...

相关内容