On Sun, Nov 08, 1998 at 01:03:24PM +0100, Matthias W�chter wrote:
> On Sun, 8 Nov 1998 [EMAIL PROTECTED] wrote:
> 
...
> 
> > Switching CPU is bad for cache utilization. But the scheduler has some
> > bias that makes the kernel favour keeping a process on the same cpu. You
> > can try to increase the value in ...linux/include/asm/smp.h: 
> 
> > #define PROC_CHANGE_PENALTY     20              /* Schedule penalty */
> 
> Interesting thing is that NT4SP3 shows exactly the same behaviour, except
> it shows constantly about 50% (+/- 10%) for each CPU.

NT is known to do the ``hot-potatoe'' trick with processes.  It sucks for cache
utilization.

> I think, this behaviour is intended to always test different utilization
> schemes to find the optimum. Think of 2 processes, each at 50% CPU
> utilization. Fine, for an optimum, they should use one CPU each. But then,
> think of a third task started which needs 100% CPU. Now, the optimum is: 
> Task 3: CPU1 alone, the other tasks on the other CPU. Do you think the
> scheduler is intelligent enough to find out how the tasks are swapped best
> from one CPU to the other?

If one cpu has zero load, and the other has two processes running, one will migrate
to the idle cpu.  If both cpus have one process running, but suddenly a lot of 
interrupts
occur (which must be handled by a cpu), one processor might end up running both 
processes,
at least for a short while.

But for sure, neither the NT nor the Linux scheduler does any simulated annealing
to find the optimum cache utilization compromise.

> > Setting this to eg. 100 should make the process less prone to switching CPU.
> 
> I see. Is there any way to see process-hopping f.e. in 2x100%-utilization
> szenarios? `top` and `ps` don't show the currently used CPU for each
> process - is there something in /proc to find out how many
> process-CPU-hops occur(ed)?

In /proc/<pid>/cpu you can see how much time a process spent on each cpu.

................................................................
: [EMAIL PROTECTED]  : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob �stergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:

Reply via email to