Print this page
6535 Add pbind -e
Reviewed by: Mohamed Khalfella <khalfella@gmail.com>
Reviewed by: Cody Mello <melloc@joyent.com>
Reviewed by: Albert Lee <trisk@omniti.com>
   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 [-q] [pid [/lwpid]]...
  13 
  14 
  15        pbind -Q [processor_id]...
  16 
  17 
  18        pbind -u pid [/lwpid]...
  19 
  20 
  21        pbind -U [processor_id]...
  22 
  23 
  24 DESCRIPTION
  25        pbind controls and queries bindings of processes and LWPs (lightweight
  26        processes) to processors. pbind can also remove processor bindings that
  27        were previously established.
  28 
  29 
  30        When an LWP is bound to a processor, it will be executed only by that
  31        processor except when the LWP requires a resource that is provided only
  32        by another processor. The binding is not exclusive, that is, the
  33        processor is free to execute other LWPs as well.
  34 
  35 
  36        Bindings are inherited, so new LWPs and processes created by a bound
  37        LWP will have the same binding. Binding an interactive shell to a
  38        processor, for example, binds all commands executed by the shell.
  39 
  40 




  41        Superusers may bind or unbind any process or LWP, while other users can
  42        bind or unbind any process or LWP for which they have permission to
  43        signal, that is, any process that has the same effective user ID as the
  44        user.
  45 
  46 OPTIONS
  47        The following options are supported:
  48 
  49        -b processor_id
  50            Binds all or a subset of the LWPs of the specified processes to the
  51            processor processor_id. Specify processor_id as the processor ID of
  52            the processor to be controlled or queried. processor_id must be
  53            present and on-line. Use the psrinfo command to determine whether
  54            or not processor_id is present and on-line. See psrinfo(1M).
  55 
  56 




  57        -q
  58            Displays the bindings of the specified processes or of all
  59            processes. If a process is composed of multiple LWPs which have
  60            different bindings and the LWPs are not explicitly specified, the
  61            bindings of only one of the bound LWPs will be displayed. The
  62            bindings of a subset of LWPs can be displayed by appending
  63            "/lwpids" to the process IDs. Multiple LWPs may be selected using
  64            "-" and "," delimiters. See EXAMPLES.
  65 
  66 
  67        -Q
  68            Displays the LWPs bound to the specified list of processors, or all
  69            LWPs with processor bindings. For processes composed of multiple
  70            LWPs, the bindings of individual LWPs will be displayed.
  71 
  72 
  73        -u
  74            Removes the bindings of all or a subset of the LWPs of the
  75            specified processes, allowing them to be executed on any on-line
  76            processor.


  85        The following operands are supported:
  86 
  87        pid
  88            The process ID of the process to be controlled or queried.
  89 
  90 
  91        lwpid
  92            The set of LWP IDs of the specified process to be controlled or
  93            queried. The syntax for selecting LWP IDs is as follows:
  94 
  95              2,3,4-8       LWP IDs 2, 3, and 4 through 8
  96              -4            LWPs whose IDs are 4 or below
  97              4-            LWPs whose IDs are 4 or above
  98 
  99 
 100 
 101        processor_id
 102            The processor ID of the processor to be controlled or queried.
 103 
 104 




 105 EXAMPLES
 106        Example 1 Binding Processes
 107 
 108 
 109        The following example binds processes 204 and 223 to processor 2:
 110 
 111 
 112          example% pbind -b 2 204 223
 113          process id 204: was 2, now 2
 114          process id 223: was 3, now 2
 115 
 116 
 117 
 118        Example 2 Unbinding a Process
 119 
 120 
 121        The following example unbinds process 204:
 122 
 123 
 124          example% pbind -u 204


 149 
 150 
 151          example% pbind -q 149/1-2
 152          lwp id 149/1: 3
 153          lwp id 149/2: not bound
 154 
 155 
 156 
 157        Example 5 Querying LWP Bindings for Processor 2:
 158 
 159 
 160        The following example queries all LWPs bound to processor 2:
 161 
 162 
 163          example% pbind -Q 2
 164          lwp id 149/4: 2
 165          lwp id 149/5: 2
 166 
 167 
 168 










 169 EXIT STATUS
 170        The following exit values are returned:
 171 
 172        0
 173            Successful completion.
 174 
 175 
 176        >0
 177            An error occurred.
 178 
 179 
 180 SEE ALSO
 181        psradm(1M), psrinfo(1M), psrset(1M), processor_bind(2),
 182        processor_info(2), sysconf(3C), attributes(5)
 183 
 184 DIAGNOSTICS
 185        pbind: cannot query pid 31: No such process
 186            The process specified did not exist or has exited.
 187 
 188 
 189        pbind: cannot bind pid 31: Not owner
 190            The user does not have permission to bind the process.
 191 
 192 
 193        pbind: cannot bind pid 31: Invalid argument
 194            The specified processor is not on-line.
 195 
 196 


 197 

 198 
 199                                February 25, 2008                     PBIND(1M)
   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.


  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


 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)