Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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 HP
A quick resolution to technical issues for your HP Enterprise products is just a click away HP Support Center Knowledge-base
See Self Help Post for more details

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.