Home / Solaris 10 / How to Identify Solaris Processor Cores ?

How to Identify Solaris Processor Cores ?

For  hardware inventory, we may need to provide the Processor details like number installed physical processors , number core per processor on Solaris SPARC and X86 system.
SunMicro system doesn’t make any complication to identify the CPU information on Solaris Operating system.To list the physical processor and core,we have the binary called “prsinfo” to pull the information. We can also look at the prtidag command to identify number of physical processors and cores. Here we will see some examples. 
 
On Solaris 10 (SPARC and X86 ),
 
1. Login as root and execute psrinfo command to list the virtual cpu’s.
[root@UQ]# psrinfo |head
0       on-line   since 01/16/2014 11:37:31
1       on-line   since 01/16/2014 11:38:46
2       on-line   since 01/16/2014 11:38:46
3       on-line   since 01/16/2014 11:38:46
4       on-line   since 01/16/2014 11:38:46
5       on-line   since 01/16/2014 11:38:46
6       on-line   since 01/16/2014 11:38:46
7       on-line   since 01/16/2014 11:38:46
8       on-line   since 01/16/2014 11:38:46
9       on-line   since 01/16/2014 11:38:46
[root@UQ]# psrinfo |tail
54      on-line   since 01/16/2014 11:38:46
55      on-line   since 01/16/2014 11:38:46
56      on-line   since 01/16/2014 11:38:46
57      on-line   since 01/16/2014 11:38:46
58      on-line   since 01/16/2014 11:38:46
59      on-line   since 01/16/2014 11:38:46
60      on-line   since 01/16/2014 11:38:46
61      on-line   since 01/16/2014 11:38:46
62      on-line   since 01/16/2014 11:38:46
63      on-line   since 01/16/2014 11:38:46
[root@UQ~]#

2.To see the installed number of physical processors.

[root@UQ]# psrinfo -p
8
[root@UQ]#


3.To see the detailed information about the physical processor,

[root@UQ]# psrinfo -pv
The physical processor has 8 virtual processors (0-7)
  SPARC64-VII (portid 1124 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (8-15)
  SPARC64-VII (portid 1132 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (16-23)
  SPARC64-VII (portid 1140 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (24-31)
  SPARC64-VII (portid 1148 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (32-39)
  SPARC64-VII (portid 1156 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (40-47)
  SPARC64-VII (portid 1164 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (48-55)
  SPARC64-VII (portid 1172 impl 0x7 ver 0xa1 clock xxxx MHz)
The physical processor has 8 virtual processors (56-63)
  SPARC64-VII (portid 1180 impl 0x7 ver 0xa1 clock xxxx MHz)
[root@UQ]#

4.We can also get the CPU information from prtdiag on SPARC systems.But X86 doesn’t offer this facility .

==================================== CPUs ====================================
      CPU                 CPU                         Run    L2$    CPU   CPU
LSB   Chip                 ID                         MHz     MB    Impl. Mask
---   ----  ----------------------------------------  ----   ---    ----- ----
 00     0      0,   1,   2,   3,   4,   5,   6,   7   xxxx   x.x        7  961
 00     1      8,   9,  10,  11,  12,  13,  14,  15   xxxx   x.x        7  961
 00     2     16,  17,  18,  19,  20,  21,  22,  23   xxxx   x.x        7  961
 00     3     24,  25,  26,  27,  28,  29,  30,  31   xxxx   x.x        7  961
 01     0     32,  33,  34,  35,  36,  37,  38,  39   xxxx   x.x        7  961
 01     1     40,  41,  42,  43,  44,  45,  46,  47   xxxx   x.x        7  961
 01     2     48,  49,  50,  51,  52,  53,  54,  55   xxxx   x.x        7  961
 01     3     56,  57,  58,  59,  60,  61,  62,  63   xxxx   x.x        7  961

From the above output, you can see CPU chip 0 has cores from 0 to 7(CPU ID). Which means CPU 0 has 8 cores. Here we have 8 physical processor and each has 8 cores. Total number of cpu core is 64 on this system.

5.For Solaris 8 and Solaris 9, we have psrinfo command but some options will not work unlike solaris 10 and 11.
For example,
There is no option like “-p” on solaris 8 and Solaris 9.

# psrinfo
0       on-line   since 04/10/12 20:29:47
1       on-line   since 04/10/12 20:29:46
# psrinfo -pv
psrinfo: illegal option -- p
usage:
        psrinfo [-v] [processor_id ...]
        psrinfo -s processor_id
#


In prtdiag also , we can’t see the cpu cores on solaris 8 and 9.

==================================== CPUs ====================================
                      E$          CPU     CPU       Temperature         Fan
       CPU  Freq      Size        Impl.   Mask     Die    Ambient   Speed   Unit
       ---  --------  ----------  ------  ----  --------  --------  -----   ----
     MB/P0  1002 MHz  1MB         US-IIIi  2.4       -        -
     MB/P1  1002 MHz  1MB         US-IIIi  2.4       -        -

6. How to disable the CPU core ? 
To disable the CPU, you need to use “/usr/sbin/psradm” command. For an exmple,If you want to disable cpu id 9, then use the below command.

# /usr/sbin/psradm -f 9

option -f used to disable the cpu core.

7.How to enable the CPU core ?
Use -n option to enable the disable the cpu cores.

# psradm -n 0


8.To disable the multiple cpu cores ,

# /usr/sbin/psradm -f 9 10 11 12 13


9.To enable the multiple cpu cores,

# /usr/sbin/psradm -n 9 10 11 12 13


10.How to offline the processor forcefully ? you need to use -F option to do that.

# psradm -F -f 19 20

11.How to set the processor as spare using psradm command.? 
The below example will make the cpu core 11 and 12 as spare processor.

# psradm -s 11 12

12.How to make the processor as spare forcefully even its in faulted state ?

# psradm -F -s 11 12

Hope this articles is useful for Solaris beginners. 

For T series servers , you won’t get  the processor core information  in “psrinfo -pv” command. You need to calculate the number cores using kstat command.

1.Execute the below command to get the one core id and processor id.

[root@T5440-UA ~]# /usr/bin/kstat -m cpu_info |egrep "chip_id|core_id" |more
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1026
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1033
        chip_id                         0
        core_id                         1040
        chip_id                         0
        core_id                         1040
        chip_id                         0
        core_id                         1040
        chip_id                         0
[root@T5440-UA ~]#

2.Just find how many threads on single core.

[root@T5440-UA ~]# /usr/bin/kstat -m cpu_info |egrep "chip_id|core_id" |grep 1026|wc -l
       8
[root@T5440-UA ~]#

As per the above output,core_id 1026 is having 8 threads.

3.Check the total number of threads per physical cpu. chip_id = 0

[root@T5440-UA ~]# /usr/bin/kstat -m cpu_info |egrep "chip_id|core_id" |grep "chip_id                         0" |wc -l
      64
[root@T5440-UA ~]#

Physical CPU (chip_id 0 ) has 64 threads.

4.To get the number of cores per cpu,use the below formula.
Number of core per cpu = Total number of thread per cpu/Total number of threads per core.

[root@T5440-UA ~]# bc
64/8
8
[root@T5440-UA ~]#

In this machine, each core is having 8 threads and per CPU , it has 8 cores. So the total number of virtual processor is 64 per processor.

Thank you for visiting UnixArena.

VMTURBO-CLOUD-CAPACITY

3 comments

  1. Hi lingeswar please post any real time issues

  2. Hi lingesh,

    Is it possible to disable the cores?

    For example my t4 is having 1 physical cpu with 8 cores and I would like to disable 4 cores from the total of 8 cores

  3. Thanks for your knowledge sharing Lingesh…

Leave a Reply

Your email address will not be published. Required fields are marked *