How to display individual CPU load using 'top' on a multiprocessor node?

Solaris 10 supports multiprocessor system. Let's say I have 2 CPUs. How can I know the load of each of the 2 CPUs by using the 'top' command?

On Linux, after you invoke 'top' you can press 1 to toggle between the combined-CPU-load setting and 'individual-CPU-load' setting. But it appears that 'top' on Solaris shows only the combined CPU load. Is there a way to show how much % CPU1 is busy and how much % CPU2 is busy, etc?

If I run on a dual processor dual core AMD Opteron node, i.e. 4 CPUs in total. How do I know which two CPUs reside on one processor, and which two on the other processor? That is, how do I know CPU1 and CPU4 are the two cores on the same processors, for example? On Linux, one can tell from /proc/cpuinfo.

[760 byte] By [minglai] at [2007-11-26 8:54:20]
# 1
OK, I found http://forum.sun.com/jive/thread.jspa?forumID=298&threadID=73220It answers the first part of my question, but not the second part.
minglai at 2007-7-6 22:50:05 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
I don't have one to test, but I believe 'psrinfo -v' and/or 'psrinfo -pv' will display the relationships between cores and physical processors.-- Darren
Darren_Dunham at 2007-7-6 22:50:05 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3

You are right. For others who are interested:

% /usr/sbin/psrinfo -pv

The physical processor has 2 virtual processors (0, 2)

x86 (chipid 0x0 AuthenticAMD family 15 model 33 step 2 clock 2000 MHz)

AMD Opteron(tm) Processor 270

The physical processor has 2 virtual processors (1, 3)

x86 (chipid 0x1 AuthenticAMD family 15 model 33 step 2 clock 2000 MHz)

AMD Opteron(tm) Processor 270

This is a HP ProLiant BL35p G1 with 2 physical processors each of which has dual cores. According to this, CPUs 0 and 2 are two cores on one processor, and CPUs 1 and 3 are the other 2 cores on another processor. Thanks. But I feel the term "virtual processor" in the output is somewhat misleading - in the presence of hyperthreading technology. The dual cores are real physical cores, they are not "virtual". I know AMD does not use hyperthreading technology for now, but who knows in the future? The term "virtual processors" make people wonder whether they are "virtual processors" as a result of some hyperthreading technology or real physical cores.

And for completeness, here is the output of 'psrinfo -v' :

% /usr/sbin/psrinfo -v

Status of virtual processor 0 as of: 07/20/2006 10:47:26

on-line since 07/05/2006 10:38:08.

The i386 processor operates at 2000 MHz,

and has an i387 compatible floating point processor.

Status of virtual processor 1 as of: 07/20/2006 10:47:26

on-line since 07/05/2006 10:38:11.

The i386 processor operates at 2000 MHz,

and has an i387 compatible floating point processor.

Status of virtual processor 2 as of: 07/20/2006 10:47:26

on-line since 07/05/2006 10:38:13.

The i386 processor operates at 2000 MHz,

and has an i387 compatible floating point processor.

Status of virtual processor 3 as of: 07/20/2006 10:47:26

on-line since 07/05/2006 10:38:15.

The i386 processor operates at 2000 MHz,

and has an i387 compatible floating point processor.

As a comparison, here is the output of 'psrinfo -pv' on a Pentium 4 with hyperthreading enabled:

% /usr/sbin/psrinfo -pv

The physical processor has 2 virtual processors (0, 1)

x86 (chipid 0x0 GenuineIntel family 15 model 4 step 3 clock 2993 MHz)

Intel(r) Pentium(r) 4 CPU 3.00GHz

Here the "virtual processors" are not real physical cores but just virtual processors due to the use of hyperthreading, because I happen to know how the system is really configured.

I hope Solaris would distinguish between virtual processors and cores. If the Solaris developers are reading this, I hope 'psrinfo' in the future would also give info about the cores. And I cannot help but wonder what the output of 'psrinfo -pv' would look like on a dual core processor with hyperthreading enabled.

minglai at 2007-7-6 22:50:05 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

Traditionally this hasn't been an issue, so there was nothing in psrinfo or the interfaces to distinguish between them. With the t1000 (32 vps on 8 cores), it's more important.

One of the nevada releases put a new kstat structure in place. I don't know if it's made it into any Solaris release or not yet. If it has, you can run:

kstat -m cpu_info | grep core_id

and get some more info. I think the core_id will be different for each vp running on a separate core.

--

Darren

Darren_Dunham at 2007-7-6 22:50:05 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5

You are right again. For Solaris 10:

on a dual-processor with dual-core on each processor (AMD Opteron 270), there are 4 different core id's:

% kstat -m cpu_info | grep core_id

core_id 0

core_id 1

core_id 2

core_id 3

on a uni-core uni-processor with hyperthreading (Pentium 4), there is only 1 cored id:

% kstat -m cpu_info | grep core_id

core_id 0

core_id 0

And there is a 'chip_id' field in the kstat output which helps tell the processor setup. 'chip_id', 'core_id' and CPU id together should tell whether there are multiple processors/cores and hyperthreading. Thanks.

minglai at 2007-7-6 22:50:05 > top of Java-index,Solaris Operating System,Solaris 10 Features...