Re: [uPATCH] SMP scheduling fix (?)

Neil Conway (nconway.list@ukaea.org.uk)
Fri, 15 Jan 1999 09:08:13 +0000


Rik van Riel wrote:
>
> 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.

Hi... This patch is flawed. If we use it, it'll reintroduce the crappy
interactive response when interactive jobs compete with non-niced
CPU-hogs. This is the one I fixed recently by making
PROC_CHANGE_PENALTY smaller than DEF_PRIORITY (changed from 20 to 15 in
other words). (And yes, I think it was only relevant to i386.)

If you want to use this type of approach (and it does seem sensible,
though I haven't given it a huge amount of thought), try something like:

weight += MIN(PROC_CHANGE_PENALTY,p->priority);

(assuming we have a MIN macro - but you get the picture).

cheers
Neil

-
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/