Using psradm to enable/disable a processor on Solaris
In multiprocessor environments, Solaris can allow enabling or disabling of processors. This although is not something that we would do all the time but can come handy when troubleshooting hardware issues.
Solaris has the psradm utility which allows enabling or disabling a processor on the system. The psradm utility changes the operational status of processors.
The legal states for the processor are:
| State | Description |
|---|---|
| on-line | An on-line processor processes LWPs (lightweight processes) and can be interrupted by I/O devices in the system. |
| off-line | An off-line processor does not process any LWPs. Usually, an off-line processor is not interruptible by I/O devices in the system. On some processors or under certain conditions, it might not be possible to disable interrupts for an off-line processor. Thus, the actual effect of being off-line might vary from machine to machine. |
| spare | A spare processor does not process any LWPs. A spare processor can be brought on-line, off-line or to no-intr by a privileged user of the system or by the kernel in response to changes in the system state. |
| faulted | A faulted processor is identified by the kernel, which monitors the behavior of processors over time. A privileged user can set the state of a faulted processor to be on-line, off-line, spare or no-intr, but must use the force option to do so. |
| no-intr | A no-intr processor processes LWPs but is not interruptible by I/O devices. |
Find the Processor ID
To enable or disable a processor on the system we need to know the Processor ID. This can be found using the psrinfo utility as follows:
root@sol001# psrinfo 0 on-line since 17/03/2007 11:53:19 1 on-line since 17/03/2007 11:53:28
The processor ID is in column 1 from the about output.
To know the path of the psradm command
root@sol001# which psradm /usr/sbin/psradm
Disable a processor
To disable (offline) a processor use the command 'psradm -f <processor-id>'. For example to disable processor 1, use the command:
root@sol001# psradm -f 1
Enable a processor
To enable (online) a processor use the command 'psradm -n <processor-id>'. For example to enable processor 1, use the command:
root@sol001# psradm -n 1
Again, you can use the psrinfo command to verify the processor state.