1. in Linux, how does one view the CPU usage:
# Top-D 1
Then press the number 1 to display multiple CPUs (the same is true for top CPU and 1 CPU)
Cpu0: 1.0% us, 3.0% Sy, 0.0% Ni, 96.0% ID, 0.0% wa, 0.0% hi, 0.0% Si, 0.0% St
Cpu1: 0.0% us, 0.0% Sy, 0.0% Ni, 100.0% ID, 0.0% wa, 0.0% hi, 0.0% Si, 0.0% St
2. in Linux, how can I check whether it is multi-core or multi-CPU:
# Cat/proc/cpuinfo
If there are multiple projects similar to the following, it is multi-core or multi-CPU:
Processor: 0
......
Processor: 1
3. How to check the CPU on which a process runs:
# Top-D 1
Then press F. To go to the top current fields settings page:
Selected: J: P = last used CPU (SMP)
If this parameter is left blank, P indicates the CPU used by the process.
Sam has been tested and found that different CPU cores are used for the same process at different times. This should be handled by Linux kernel SMP.
4. Configure Linux kernel to support multiple cores:
The config_smp option must be enabled during Kernel configuration to make the kernel aware of SMP.
Processor type and features ---> hierarchical Ric multi-processing support
Check whether or not Linux kernel supports (or uses) SMP
# Uname-