lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] Implementing temporal affinity
Date
From: "Chris Swiedler" <ceswiedler@mindspring.com>
> I'm wondering if we could implement this by generalizing the SMP
> processor-affinity goodness() calculation. Right now, we give a "largish
> advantage" to the process whose last_processor == this_cpu. Every time we
> schedule a process onto a CPU, we set last_processor to that CPU. But if
we
> only set last_processor after the process has run on that CPU for a
certain
> number of cycles, then processes which didn't run for at least that long
> wouldn't "own" the CPU, and wouldn't get the scheduling advantage.

Let's say the minimum time is 50 cycles:

Process A last_cpu = 1
Process B last_cpu = 1
Process C last_cpu = 1

Process C runs for 200 cycles on CPU 1
Process C last_cpu = 1
Process A runs for 300 cycles on CPU 2
Process A last_cpu = 2

Process C is running on CPU 1
Process C last_cpu = 1
Process B runs for 15 cycles on CPU 2 but is interrupted
Process B last_cpu = 1 (unaltered)

Here we have:
Process A last_cpu = 2
Process B last_cpu = 1
Process C last_cpu = 1
C is currenty running on 1
Scheduler needs to pick a process for 2
A runs on 2

C is starved

I think you would have to not set last_cpu at all in
order to have time affinity work properly.

..Stu


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

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.043 / U:0.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site