12

The output of lscpu of my pc looks like --

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
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
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 69
Stepping:              1
CPU MHz:               1200.093
BogoMIPS:              3392.08
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3

Does it means I have 4 cpus and 2 cores?

6
  • 3
    One chip (socket) with two cores that shows up as a total of four CPUs to the system due to hyper-threading. Commented May 10, 2017 at 9:02
  • 2
    @Kusalananda, The CPU(s) in the lscpu gives the number of logical central processing units (number of cores ) in one physical CPU. Isn't it ? Commented May 10, 2017 at 9:06
  • @saisasanka Yes. Related question: unix.stackexchange.com/questions/88283/… Commented May 10, 2017 at 9:09
  • 1
    @saisasanka In this case, there are 4 CPUs and 2 cores in 1 socket. The socket is physical, as are the cores on it. Each core shows as 2 CPUs ("Threads per core"). Commented May 10, 2017 at 9:11
  • CPU(s) = Core(s) per socket * Thread(s) per core Commented Jul 3, 2017 at 6:57

2 Answers 2

11

From man lscpu:

CPU
The logical CPU number of a CPU as used by the Linux kernel.

CORE
The logical core number. A core can contain several CPUs.

SOCKET
The logical socket number. A socket can contain several cores.

So yes, you have 4 CPUs, contained in physical 2 cores, contained in one physical socket.

You can get the same information from cat /proc/cpuinfo.

Related question: So what are logical cpu cores (as opposed to physical cpu cores)?

2
  • does it means I can run 4 instruction at a time? Commented May 10, 2017 at 14:20
  • 1
    More or less. It means it can run 4 tasks in parallel. See HyperThreading: en.wikipedia.org/wiki/Hyper-threading Commented May 10, 2017 at 14:45
5

To avoid confusion between logical and physical processors,

Intel refers to a physical processor as a socket.


Hyperthreading technology allows a single processor core to execute two independent threads simultaneously.

While hyperthreading does not double the performance of a system, it can increase performance by better utilizing idle resources leading to greater throughput for certain important workload types. An application running on one logical processor of a busy core can expect slightly more than half of the throughput that it obtains while running alone on a non-hyperthreaded processor.

Summary

  • Your system has one physical CPU (Let's name it as X)
  • Hyperthreading makes CPU X to behave like two CPUs (CPU - X1 and CPU - X2) but physically not.
  • Each X1 and X2 can execute two thread at a time, simultaneously

To summarize, you have one physical processor which can execute 4 threads simultaneously.

1
  • "An application running on one logical processor of a busy core can expect slightly more than half of the throughput that it obtains while running alone on a non-hyperthreaded processor". Does this mean that hyperthreading makes a core run at lightly over half its capacity? Commented Mar 27, 2020 at 8:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.