1 PBIND(1M)                    Maintenance Commands                    PBIND(1M)
   2 
   3 
   4 
   5 NAME
   6        pbind - control and query bindings of processes or LWPs
   7 
   8 SYNOPSIS
   9        pbind -b processor_id pid [/lwpid]...
  10 
  11 
  12        pbind -e processor_id cmd [args...]
  13 
  14 
  15        pbind [-q] [pid [/lwpid]]...
  16 
  17 
  18        pbind -Q [processor_id]...
  19 
  20 
  21        pbind -u pid [/lwpid]...
  22 
  23 
  24        pbind -U [processor_id]...
  25 
  26 
  27 DESCRIPTION
  28        pbind controls and queries bindings of processes and LWPs (lightweight
  29        processes) to processors. pbind can also remove processor bindings that
  30        were previously established.
  31 
  32 
  33        When an LWP is bound to a processor, it will be executed only by that
  34        processor except when the LWP requires a resource that is provided only
  35        by another processor. The binding is not exclusive, that is, the
  36        processor is free to execute other LWPs as well.
  37 
  38 
  39        Bindings are inherited, so new LWPs and processes created by a bound
  40        LWP will have the same binding. Binding an interactive shell to a
  41        processor, for example, binds all commands executed by the shell.
  42 
  43 
  44        The processor_id must be present and on-line. Use the psrinfo(1M)
  45        command to determine which processors are available.
  46 
  47 
  48        Superusers may bind or unbind any process or LWP, while other users can
  49        bind or unbind any process or LWP for which they have permission to
  50        signal, that is, any process that has the same effective user ID as the
  51        user.
  52 
  53 OPTIONS
  54        The following options are supported:
  55 
  56        -b processor_id
  57            Binds all or a subset of the LWPs of the specified processes to
  58            processor_id.
  59 
  60 
  61        -e processor_id
  62            Execute a command while bound to processor_id.
  63 
  64 
  65        -q
  66            Displays the bindings of the specified processes or of all
  67            processes. If a process is composed of multiple LWPs which have
  68            different bindings and the LWPs are not explicitly specified, the
  69            bindings of only one of the bound LWPs will be displayed. The
  70            bindings of a subset of LWPs can be displayed by appending
  71            "/lwpids" to the process IDs. Multiple LWPs may be selected using
  72            "-" and "," delimiters. See EXAMPLES.
  73 
  74 
  75        -Q
  76            Displays the LWPs bound to the specified list of processors, or all
  77            LWPs with processor bindings. For processes composed of multiple
  78            LWPs, the bindings of individual LWPs will be displayed.
  79 
  80 
  81        -u
  82            Removes the bindings of all or a subset of the LWPs of the
  83            specified processes, allowing them to be executed on any on-line
  84            processor.
  85 
  86 
  87        -U
  88            Removes the bindings of all LWPs bound to the specified list of
  89            processors, or to any processor if no argument is specified.
  90 
  91 
  92 OPERANDS
  93        The following operands are supported:
  94 
  95        pid
  96            The process ID of the process to be controlled or queried.
  97 
  98 
  99        lwpid
 100            The set of LWP IDs of the specified process to be controlled or
 101            queried. The syntax for selecting LWP IDs is as follows:
 102 
 103              2,3,4-8       LWP IDs 2, 3, and 4 through 8
 104              -4            LWPs whose IDs are 4 or below
 105              4-            LWPs whose IDs are 4 or above
 106 
 107 
 108 
 109        processor_id
 110            The processor ID of the processor to be controlled or queried.
 111 
 112 
 113        cmd [args...]
 114            The command to execute along with optional arguments.
 115 
 116 
 117 EXAMPLES
 118        Example 1 Binding Processes
 119 
 120 
 121        The following example binds processes 204 and 223 to processor 2:
 122 
 123 
 124          example% pbind -b 2 204 223
 125          process id 204: was 2, now 2
 126          process id 223: was 3, now 2
 127 
 128 
 129 
 130        Example 2 Unbinding a Process
 131 
 132 
 133        The following example unbinds process 204:
 134 
 135 
 136          example% pbind -u 204
 137 
 138 
 139 
 140        Example 3 Querying Bindings
 141 
 142 
 143        The following example queries bindings. It demonstrates that process 1
 144        is bound to processor 0, process 149 has at least one LWP bound to
 145        CPU3, and process 101 has no bound LWPs.
 146 
 147 
 148          example% pbind -q 1 149 101
 149          process id 1: 0
 150          process id 149: 3
 151          process id 101: not bound
 152 
 153 
 154 
 155        Example 4 Querying LWP Bindings
 156 
 157 
 158        The following example queries bindings of LWPs. It demonstrates that
 159        LWP 1 of process 149 is bound to CPU3, and LWP 2 of process 149 is not
 160        bound.
 161 
 162 
 163          example% pbind -q 149/1-2
 164          lwp id 149/1: 3
 165          lwp id 149/2: not bound
 166 
 167 
 168 
 169        Example 5 Querying LWP Bindings for Processor 2:
 170 
 171 
 172        The following example queries all LWPs bound to processor 2:
 173 
 174 
 175          example% pbind -Q 2
 176          lwp id 149/4: 2
 177          lwp id 149/5: 2
 178 
 179 
 180 
 181        Example 6 Executing a bound command:
 182 
 183 
 184        The following example executes ls while bound to processor 6:
 185 
 186 
 187          example% pbind -e 6 ls -la
 188 
 189 
 190 
 191 EXIT STATUS
 192        The following exit values are returned:
 193 
 194        0
 195            Successful completion.
 196 
 197 
 198        >0
 199            An error occurred.
 200 
 201 
 202 SEE ALSO
 203        psradm(1M), psrinfo(1M), psrset(1M), processor_bind(2),
 204        processor_info(2), sysconf(3C), attributes(5)
 205 
 206 DIAGNOSTICS
 207        pbind: cannot query pid 31: No such process
 208            The process specified did not exist or has exited.
 209 
 210 
 211        pbind: cannot bind pid 31: Not owner
 212            The user does not have permission to bind the process.
 213 
 214 
 215        pbind: cannot bind pid 31: Invalid argument
 216            The specified processor is not on-line.
 217 
 218 
 219        pbind: failed to exec cmd
 220            Could not resolve the cmd from PATH.
 221 
 222 
 223 
 224                                February 25, 2008                     PBIND(1M)