问题
I was wondering how can I check on my running machine, whether the kernel is configured for SMP or not? Of course, I can look into the kernel .config
file and can search for it. But, the question is let's say I don't have a source code, how will I check the SMP configuration? Is there any proc file to check it?
The following says that I have no multi-cores:
#cat /proc/cpuinfo
processor : 1
cpu model : Broadcom BMIPS5000 V1.1 FPU V0.1
BogoMIPS : 651.26
cpu MHz : 1305.018
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : no
ASEs implemented :
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
The output of uname -a
says:
Linux 136.170.193.3 3.3.8-2.4 #2 SMP Fri Dec 13 07:11:03 EST 2013 mips GNU/Linux
A bit confusing here. Someone on the comments suggested me to check uname -a
. I am not sure whether the results are reliable or not. Can I assume that with the keyword SMP produced by uname -a
, the kernel is configured as SMP?
回答1:
Can I assume that with the keyword SMP produced by uname -a, the kernel is configured as SMP?
Yes. The version string returned by uname is generated when kernel is compiled.
回答2:
The "top" command may help towards this, you can see the list of running tasks and the current processor id on which they are executing by using -
top -H
then press f
to go to field selection, and j
enable the CPU core column, and Enter
to display.
the core information will be displayed under P
column.
回答3:
In case of embedded systems,
It is CONFIG_SMP=y
, not CONFIG_CMP=y
zcat /proc/config.gz | grep CONFIG_SMP
In case of Desktop,
find your config file from /boot directory and grep for CONFIG_SMP
, it should be =y
回答4:
In Linux configuration, check for CONFIG_SMP=y
. If this configuration is set then your kernel runs with Symmetric multiprocessing
.
Find your config file in /boot (usually file name as config-$(uname -r)
on ubuntu) or else check in the /proc/config.gz
.
回答5:
just check using
ps
command and check the cpu id.
You can even use the
ps -ef
来源:https://stackoverflow.com/questions/20852902/how-to-check-whether-smp-is-enabled-or-disabled-in-the-kernel