lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC] Implementing temporal affinity
Date
Dmitris Michailidis recently mentioned a desire to have the kernel implement
temporal affinity, where a process which is briefly interrupted has a better
chance of being scheduled. The idea would be that if the interrupting
process ran briefly enough, the CPU cache would still contain
instructions/data from the previous process.

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.

Looking at the code, however, I don't see how we can tell how long a process
has been on a CPU. We could add a field to task_struct which indicates this.
Also this would require that we remove the #ifdef __SMP__ for the processor
and last_processor fields in the task_queue. So we'd be increasing the size
of the task_struct by 3 ints for UP, which by itself may make the idea not
worthwhile...

Any opinions?

Chris Swiedler

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