lkml.org 
[lkml]   [1999]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: CPU affinity
Date
From
Ingo Molnar wrote:
>
> On Thu, 15 Apr 1999, Richard Gooch wrote:
>
> > It looks to me that the underlying problem is that xosview steals the
> > CPU that the number cruncher is running on, instead of using the other
> > CPU (which I presume is idle). That shouldn't happen. If it does, it's
> > a bug.
>
> this is not a bug, it's because xosview is an 'interactive' process, and
> such it has higher priority. (and the right to kick a lowprio process out,
> especially if xosview ran on that CPU previously). Btw., xosview's active
> timeslice is several msecs on a typical SMP box, so this is definitely not
> an outright bad decision by the scheduler.
>
> i have the plan to do per-process and per-CPU 'cache-set tracking' via
> performance counters in 2.3 (basically what you see in 2.2 is already a
> variant of this). That one has a chance to weigh a process's priority with
> it's active cachesize.
>
> anyway, even with 2.2.5 the expected behavior is that the number-cruching
> process settles on one CPU after some initial ping-pong, and xosview
> settles on some other CPU. If this does not happen _thats_ a bug. Anyway,
> be careful with xosview, it's obviously a bit tricky to measure scheduling
> with a tool that itself is rather intrusive as well ...

Richard Gooch has plotted a good "graphical" picture of what probably
goes on in this case:


CPU0 CPU1
crunch idle
crunch xosview
X xosview
X idle
X crunch
idle crunch

Now, if the "X" process only requires a few milliseconds it might be
better to keep CPU1 idle for that time.

A quick-and-dirty heuristic would be to leave "CPU1" idle in this case
until the next timer tick. If CPU0 is still busy at that time it
becomes time to give the cruncher a chance on CPU1.

But if Mingo says that the current heuristics already are good enough,
there is no point in trying to do it even better.

Roger.

--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.049 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site