ONCPU(8) — MAINTENANCE COMMANDS
NAME
oncpu − manipulate processors on which a process runs.
SYNOPSIS
/usr/etc/oncpu −ppid
/usr/etc/oncpu −ppid cpu_set
/usr/etc/oncpu −apid
/usr/etc/oncpu −npid
/usr/etc/oncpu −A
/usr/etc/oncpu −N
/usr/etc/oncpu cpu_set [ command ]
DESCRIPTION
oncpu is used to manipulate the processors on which a process can run and to control whether processes have an affinity for the last processor on which they ran. Processor affinity specifies if a process is trying to run on the same CPU for an extended length of time. With affinity the CPU’s local cache state is preserved, an advantage with large physical caches. The disadvantage of affinity is that the latency until a process runs may increase. OS/MP implements a dynamic affinity mechanism which will balance load across available processors, with each process having an affinity to the processor on which it last ran. When the load becomes too large, reducing the likelihood of meaningful cache states being intact, affinity is disabled. This dynamic affinity mechanism is enabled by default. oncpu can be used to enable or disable this dynamic affinity per process, or for the entire system. oncpu can also limit processes to run on a restricted set of processors.
The numeric cpu_set field is interpreted as the processor number if the value is decimal or is a hexidecimal (i.e., preceded by 0x). bit mask with bits set for each CPU on which a process can run. In order to restrict a particular process to running on processor number 0, use the cpu_set value 0. In order to restrict a particular process to run on processor 0, 1, 2, or 4, use the cpu_set value 0x17.
When child is created its initial cpu_set and affinity are inherited from its parent.
oncpu assumes that the kernel running is called /vmunix. If another kernel is running, a different kernel_file must be specified at the end of the command.
The oncpu command has a number of forms:
oncpu
Display the current cpu_set and affinity for process pid.
oncpu
Restrict process pid to run on the CPUs specified in cpu_set.
oncpu
Enable dynamic affinity for process pid.
oncpu
Disable dynamic affinity for process pid.
oncpu
Enable dynamic affinity for all processes on the system which have not had affinity disabled via the −n option.
oncpu
Disable dynamic affinity for all processes on the system.
oncpu cpu_set [command]
Execute the specified command, restricting it to to run on the CPUs specified in cpu_set. If command is not specified then the parent of oncpu is restricted to run on the CPUs specified in cpu_set.
NOTES
Attempting to restrict a process so that it can not run on any CPU causes a process to be restricted to run on the CPU where the oncpu command was executing.
Attempting to restrict a process to run on a nonexistent processor causes the whole operation to fail. That is, if the -p option is being used, the restriction operation fails. If no - options are being used, the command is not executed.
FILES
/vmunix the kernel
SEE ALSO
Solbourne Computer, Inc. — 11 Jan 1994