[lkml]   [1999]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[uPATCH] SMP scheduling fix (?)
    Hi Linus,

    I (and other people?) have noted that, on SMP systems,
    niced tasks get more CPU than they deserve. In fact,
    you often see that 2 non-niced tasks have to share a
    CPU while 2 niced tasks get the other CPU...

    This is probably because the PROC_CHANGE_PENALTY is
    _larger_ than the priority of the niced task to begin
    with, so the niced task gets it's priority more than
    doubled and the normal task can't get through...

    This patch may fix the problem by giving a large bonus
    to 'normal' processes and a smaller one to niced tasks.
    It also removes the standard 'weight += p->priority'
    because that one was a workaround for the bug in tty_ioctl.c
    and we shouldn't need it any more now that that's fixed.


    Rik -- If a Microsoft product fails, who do you sue?
    | Linux memory management tour guide. |
    | Scouting Vries cubscout leader. |

    --- kernel/sched.c.old
    +++ kernel/sched.c
    @@ -365,13 +365,12 @@
    /* Give a largish advantage to the same processor... */
    /* (this is equivalent to penalizing other processors) */
    if (p->processor == this_cpu)
    - weight += PROC_CHANGE_PENALTY;
    + weight += p->priority;

    /* .. and a slight advantage to the current thread */
    if (p->mm == prev->mm)
    weight += 1;
    - weight += p->priority;

    return weight;

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:49    [W:0.019 / U:35.884 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site