Linux view/proc/cpuinfo

Source: Internet
Author: User

The/proc/cpuinfo file has been updated in the latest versions of some operating systems to support multiple platforms. If the/proc/cpuinfo file in your system correctly reflects the processor information, you do not need to perform the preceding steps. Otherwise, the information in this article can be used for explanation.

The/proc/cpuinfo file contains the data section of each processor on the system. There are six entries in the/proc/cpuinfo description for multi-core and super-thread (HT) technical checks: processor, vendor ID, physical ID, siblings, core ID and CPU cores.

 

The processor entry contains the unique identifier of the logical processor.

Physical ID entries include the unique identifier of each physical encapsulation.

The core ID Entry stores the unique identifier of each kernel.

The siblings entry lists the number of logical processors in the same physical encapsulation.

The CPU cores entry contains the number of cores in the same physical encapsulation.

 

If the processor is an Intel processor, the string in the vendor ID entry is genuineintel.

1. All logical processors with the same physical ID share the same physical outlet. Each physical ID represents a unique physical encapsulation.

2. Siblings indicates the number of logical processors located on the physical encapsulation. They may or may not support hyper-threading (HT) technology.

3. Each core ID represents a unique processor kernel. All logical processors with the same core ID are located on the same processor kernel.

4. If more than one logical processor has the same core ID and physical ID, The system supports hyper-threading (HT) technology.

5. If two or more logical processors have the same physical ID but the core ID is different, it indicates that this is a multi-core processor. The CPU cores entry can also indicate whether multiple kernels are supported.

For example, if the system contains two physical packages and each package contains two processor kernels that support hyper-threading (HT) technology, the/proc/cpuinfo file contains this data. (Note: The data is not in the Table .)

 

Processor

 

0

 

1

 

2

 

3

 

4

 

5

 

6

 

7

 

Physical ID

 

0

 

1

 

0

 

1

 

0

 

1

 

0

 

1

 

Core ID

 

0

 

2

 

1

 

3

 

0

 

2

 

1

 

3

 

Siblings

 

4

 

4

 

4

 

4

 

4

 

4

 

4

 

4

 

CPU Cores

 

2

 

2

 

2

 

2

 

2

 

2

 

2

 

2

 

1. This example shows that logical processor 0 and 4 reside on Kernel 0 of physical encapsulation 0. This indicates that the logical processors 0 and 4 support hyper-threading (HT) technology.

2. the same work can be used to encapsulate the logical processors 2 and 6 on the 0 kernel 1, the logical processors 1 and 5 on the 1 kernel 2, it also encapsulates logical processors 3 and 7 on Kernel 3.

3. This system supports hyper-threading (HT) technology because two logical processors share the same kernel.

4. There are two ways to determine whether multiple kernels are supported:

A. Because kernel 0 and 1 exist on encapsulation 0, and kernel 2 and 3 exist on encapsulation 1, this is a multi-kernel system.

B. In addition, if the CPU cores entry is 2, two kernels reside in the physical encapsulation. This is a multi-channel system, because there are two packages.

It is worth noting that the numbers of physical IDs and core IDs may or may not be consecutive. Two physical packages on the system are not uncommon, and physical ID is equal to 0 and 3

You can use the following method to query the CPU usage:

1. Number of logical CPUs:

# Cat/proc/cpuinfo | grep "processor" | WC-l

2. Number of physical CPUs:

# Cat/proc/cpuinfo | grep "Physical ID" | sort | uniq | WC-l

3. Number of cores in each physical CPU:

# Cat/proc/cpuinfo | grep "CPU cores" | WC-l

Is it hyper-threading?

If two logical CPUs have the same core ID, hyper-threading is enabled.

4. The number of logical CPUs (possibly core, threads, or both) in each physical CPU:

# Cat/proc/cpuinfo | grep "Siblings"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.