PBIND(8) | Maintenance Commands and Procedures | PBIND(8) |
pbind - control and query bindings of processes or LWPs
pbind -b processor_id pid [/lwpid]...
pbind -e processor_id cmd [args...]
pbind [-q] [pid [/lwpid]]...
pbind -Q [processor_id]...
pbind -u pid [/lwpid]...
pbind -U [processor_id]...
pbind controls and queries bindings of processes and LWPs (lightweight processes) to processors. pbind can also remove processor bindings that were previously established.
When an LWP is bound to a processor, it will be executed only by that processor except when the LWP requires a resource that is provided only by another processor. The binding is not exclusive, that is, the processor is free to execute other LWPs as well.
Bindings are inherited, so new LWPs and processes created by a bound LWP will have the same binding. Binding an interactive shell to a processor, for example, binds all commands executed by the shell.
The processor_id must be present and on-line. Use the psrinfo(8) command to determine which processors are available.
Superusers may bind or unbind any process or LWP, while other users can bind or unbind any process or LWP for which they have permission to signal, that is, any process that has the same effective user ID as the user.
The following options are supported:
-b processor_id
-e processor_id
-q
-Q
-u
-U
The following operands are supported:
pid
lwpid
2,3,4-8 LWP IDs 2, 3, and 4 through 8 -4 LWPs whose IDs are 4 or below 4- LWPs whose IDs are 4 or above
processor_id
cmd [args...]
Example 1 Binding Processes
The following example binds processes 204 and 223 to processor 2:
example% pbind -b 2 204 223 process id 204: was 2, now 2 process id 223: was 3, now 2
Example 2 Unbinding a Process
The following example unbinds process 204:
example% pbind -u 204
Example 3 Querying Bindings
The following example queries bindings. It demonstrates that process 1 is bound to processor 0, process 149 has at least one LWP bound to CPU3, and process 101 has no bound LWPs.
example% pbind -q 1 149 101 process id 1: 0 process id 149: 3 process id 101: not bound
Example 4 Querying LWP Bindings
The following example queries bindings of LWPs. It demonstrates that LWP 1 of process 149 is bound to CPU3, and LWP 2 of process 149 is not bound.
example% pbind -q 149/1-2 lwp id 149/1: 3 lwp id 149/2: not bound
Example 5 Querying LWP Bindings for Processor 2:
The following example queries all LWPs bound to processor 2:
example% pbind -Q 2 lwp id 149/4: 2 lwp id 149/5: 2
Example 6 Executing a bound command:
The following example executes ls while bound to processor 6:
example% pbind -e 6 ls -la
The following exit values are returned:
0
>0
processor_bind(2), processor_info(2), sysconf(3C), attributes(7), psradm(8), psrinfo(8), psrset(8)
pbind: cannot query pid 31: No such process
pbind: cannot bind pid 31: Not owner
pbind: cannot bind pid 31: Invalid argument
pbind: failed to exec cmd
February 25, 2008 | OmniOS |