Real scheduler problem? [Was: Re: [patch] Re: CPU affinity]

Simon Kirby (sim@netnation.com)
Sun, 18 Apr 1999 02:09:17 -0700 (PDT)


On Fri, 16 Apr 1999, Andrea Arcangeli wrote:
> On Wed, 14 Apr 1999, Don Fisher wrote:
>
> >I ran the Float benchmark and monitored the CPU activity using xosview. The task
> >changed cpus about every 2 seconds. And this was the only user process running
>
> I know why this happens. Basically the problem is that right now we are
> not checking if there are other cpus idle before rescheduling the current
> task. This mean that we may have a CPU idle and we may not use it (even
> if maybe the wakenup task prefer the idle cpu... bad).
>
> So I developed a minimal patch (against 2.2.5) to avoid this scheduler
> problem:

I noticed something odd while playing around trying to figure out why my
first Celeron is getting warmer than my second Celeron doing the same
thing...If I run the following on standard 2.2.6:

nice --99 perl -e 'a:goto a' &
perl -e 'a:select "","","",0.01;print STDERR ".";goto a'

...the pattern of periods appearing seems to be chunky and it looks as if
the second process is unable to run even when there is one CPU available
and the first process should be able to run on the other. It looks
exactly as if there is only one CPU in the system.

Removing the "nice --99" makes it appear to run smoothly, and not removing
it and adding the same to the second process seems to run smoothly after
an initial pause -- this doesn't make much sense to me. Nothing else is
running on the system...

I applied Andrea's patch to see if it made any difference, and it now
seems to be smooth regardless of the nice value anywhere. Does this make
any sense?

--
Note:  The processes I was playing with also stopped bouncing after I
applied the patch, as Andrea tried to accomplish.  I did like a little bit
of bouncing (perhaps once every 10-30 seconds) because it would help keep
my CPUs cooler by spreading out a single busy process.  I wonder if
purposely shuffling the CPU for a process every so often would be worth it
-- if it helps prolong the life of the CPUs in a machine a bit longer, it
could be good; and, if it's once ever half minute or so, I doubt the cache
loss would be noticeable...but then it could also be regarded as
unnecessary bloat.  Hmm... :)

Simon-

| Simon Kirby | Systems Administration | | mailto:sim@netnation.com | NetNation Communications | | http://www.netnation.com/ | Tech: (604) 684-6892 |

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