lkml.org 
[lkml]   [1999]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: CPU affinity
On Wed, 14 Apr 1999, Alan Cox wrote:

> > I am also doing video processing. And I have Xeons with 2Mb of cache. The entire
> > accumulated image result can/will live in the L2 cache. If I change cpu's,
> > don't I loose the benefit of having the large (and expensive) L2 cache?
>
> Thats why the kernel will try and keep tasks glued to a CPU. The hard case
> is do you idle a CPU for a while or move a task onto it.

Maybe it's an idea to add this change to kernel/sched.c::goodness()

if (p == prev)
weight += 1;
}
-->
else if (p->processor != this_cpu)
weight = -1;
<--
return weight;
}

This makes sure that a proces that has run out of time slice
doesn't switch CPU just yet (because it's at the head of the
run queue or something silly like that).

I think it won't affect the code path or the scheduling
behaviour very much, except for the fact that it'll cause
processes to stick to their CPU much better.

I'll add it to my patch tonight and see what happens...

Rik -- Open Source: you deserve to be in control of your data.
+-------------------------------------------------------------------+
| Le Reseau netwerksystemen BV: http://www.reseau.nl/ |
| Linux Memory Management site: http://humbolt.geo.uu.nl/Linux-MM/ |
| Nederlandse Linux documentatie: http://www.nl.linux.org/ |
+-------------------------------------------------------------------+


-
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.069 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site