Skip to contentSkip to conversation

the value of PROC_CHANGE_PENALTY

DISCUSSION Tsafrir Dan 1 participant 1 message Jun 3, 2001

lore
Share & tools
lore
#0 lore raw

as I understand, for i386 in Linux-2.2.x the default length of a quantum was 200ms, and in 2.4.x it had changed to 50ms (
according to the following 2.4.5 sched.c code:

    #if HZ < 200
    #define TICK_SCALE(x)   ((x) >> 2)
    ...
    #define NICE_TO_TICKS(nice)     (TICK_SCALE(20-(nice))+1)
    ...
    /* in the `recalculate' portion of schedule(): ... */
    for_each_task(p)
        p->counter = (p->counter >> 1) + NICE_TO_TICKS(p->nice);

)

But,
the value of PROC_CHANGE_PENALTY was not changed accordingly, and is still 15. This means that the result of the following goodness() code:

    if (p->processor == this_cpu)
        weight += PROC_CHANGE_PENALTY;

is that any task that executed on `this_cpu' (goodness > 15) will always be more "desirable" then a task that executed on another cpu (goodness <= 6) which was not the case in 2.2.x .

am I correct ?
and if so, is this what the authors meant, or did they simply forget to update PROC_CHANGE_PENALTY's value when moving from 2.2 to 2.4 ?

please cc me: [email protected]
thanks, dan.