Operating System - Tru64 Unix
1753863 Members
7590 Online
108809 Solutions
New Discussion юеВ

Bind process to a specific CPU

 
dirkm
Occasional Contributor

Bind process to a specific CPU

I've been digging into this, and I found a command to bind a pid to a cpu:

runon -P pid cpu_id


My question is: how can I confirm, check afterwards if the bind was successful ? Is there a command to see which processes are bound to which cpu's ?

Dirk
2 REPLIES 2
Martin Moore
HPE Pro

Re: Bind process to a specific CPU

Yes, there is. You can use the "-o psr" flag to ps to display the CPU on which a process is running. For example, if I want to check process 920001:

% ps -p 920001 -o pid -o psr
PID PSR
920001 1

This process is running on CPU 1 at the moment. If the process is bound to the CPU, there will be a "~" in front of the CPU number.

There's also "-o pset" if you're using processor sets. With this flag, "^" indicates the process is bound to the pset.

You can of course combine these with other ps flags.

Martin
I work for HPE
A quick resolution to technical issues for your HPE products is just a click away HPE Support Center
See Self Help Post for more details

Accept or Kudo

dirkm
Occasional Contributor

Re: Bind process to a specific CPU

Wonderful ! I just tested it and it worked 100%

Thank you very much Martin. I really appreciate it.