System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Multi CPU HPUX 11.23 default Process CPU distribution

 
SOLVED
Go to solution
Kasper_USB
Frequent Advisor

Multi CPU HPUX 11.23 default Process CPU distribution

I'm interesting for an answer of the following question:

how HPUX 11.23 distributes the processes to the CPU into an dual CPU System per default ?

The attachment shows the output from top.
I see there that some processes belong to CPU 0 and others to CPU 1.

many thanks for all feedbacks.

Olaf
6 REPLIES
Laurent Menase
Honored Contributor

Re: Multi CPU HPUX 11.23 default Process CPU distribution

regularly the kernel evaluate the length of the run queues of each cpu, and tries to spread the ready threads over all the cpus.

you can control on which cpu your process is running with mpctl()
Hein van den Heuvel
Honored Contributor

Re: Multi CPU HPUX 11.23 default Process CPU distribution

Once a given process is assigned to a given CPU, the scheduler tries to keep that process running there. That will allow for a better chance for the various caches to be used.
This is not exclusive, just a factor the scheduler uses in deciding where to start a thread when it becomes runnable. Like a gravety force, or a leash. But 'when you gotta go, you gotta go'.
There are mutliple scheduler choices (realtime, timeshare) and run time tweaks (mpsched) on hpux so 'it depends'.
Please note that the exact behavior may be release dependent (this is the stuff that gets tweaked for better (TPC-C) benchmark results) and platform dependent (Cellboards, numa)
Several papers / forum topics have been written on this before. Check with google using keywords such as affinity and mpsched.

hth,
Hein van den Heuvel
HvdH Performance Consulting.
Kasper_USB
Frequent Advisor

Re: Multi CPU HPUX 11.23 default Process CPU distribution

Hello Hein van den Heuvel

Did i understand you right that the scheduler dynamical (during process runtime) decides to change the cpu of a given process if he think that the other cpu gives the faster result ?

Die i understand you right, that the screenshot i take is not static belonging the process/cpu#. So that it can be that in some time later the same process is on the other cpu (of cause a optimization decision in the scheduler) ?

Thanks for feedback.

Olaf
Dennis Handly
Acclaimed Contributor
Solution

Re: Multi CPU HPUX 11.23 default Process CPU distribution

>decides to change the CPU of a given process if he thinks that the other CPU gives the faster result?

Or is just less busy.

>some time later the same process is on the other CPU (of cause a optimization decision in the scheduler)?

Yes.
Emil Velez
Honored Contributor

Re: Multi CPU HPUX 11.23 default Process CPU distribution

every second the monarch processor calculates the CPU utilization of all of the CPUS. IF the busiest and least busiest differ by over 20% then it may move a thread from the busiest cpu to the least busiest cpu.

If this is a cell based system it does this for the cpus in a cell then across cells.
Laurent Menase
Honored Contributor

Re: Multi CPU HPUX 11.23 default Process CPU distribution

> Did i understand you right that the
scheduler dynamical (during process
runtime) decides to change the cpu
of a given process if he think that
the other cpu gives the faster result ?

Yes looking at the length of the queue of threads waiting on each cpu queues in READY state ( this queue is named runqueue). So only READY threads but not RUNNING processes are switched to an other processor queue.

The scheduler tries to balance runqueue length when they are larger than some values.

> Die i understand you right, that the
> screenshot i take is not static belonging
> the process/cpu#. So that it can be that
> in some time later the same process is on
> the other cpu (of cause a optimization
> decision in the scheduler) ?

Yes, except if your threads/processes are bound to a cpu through pset, mpsched(1) or mpctl(2).