Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2001 22:19:49 -0500 (CDT)
From:      Henry Miller <hank@black-hole.com>
To:        "E.B. Dreger" <eddy+public+spam@noc.everquick.net>
Cc:        smp@FreeBSD.ORG
Subject:   Re: per cpu runqueues, cpu affinity and cpu binding.
Message-ID:  <Pine.BSF.4.21.0107032151330.15604-100000@daphne.bogus>
In-Reply-To: <Pine.LNX.4.20.0107021628210.14203-100000@www.everquick.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 2 Jul 2001, E.B. Dreger wrote:

> > First of all, we have two different types of processor affinity.
> > 1. user specified CPU attachment, as you have implemented.
> > 2. system-wide transparent processor affinity, transparent
> >    to all users, which I see some work below.
> 
> Unless two processes are running on CPU #1, and CPU #2 becomes idle.
> Then switching a process to CPU #2 makes sense... unless the process
> getting switched is "close" to completion.
> 
> I'll probably get flamed for suggesting something so ugly, but should we
> assume that non-daemon processes are short-running, and be more resistant
> to switching CPUs on those?

Accually some OS theory says that the longer a process runs the lower
priority it should get.  A simple extention says that if two process are
running "alot" and are on the same CPU, and there is an idle CPU, then we
should switch one process to the other CPU.  

Small tasks that can complete in just a few time slices should be run
quickly.  Even with a load of 1000 on a sinlge CPU machine we should note
that those other processes have been running for a while and schedual the
new task more often for a few rounds, and drop the priority if it doesn't
complete "quickly".  (This obviously doesn't apply for time/safety
critical threads)  If we are even half way intellegent about schedualing
initial CPU, then there is no need to bother switching CPUs for the short
lived programs as they will exit before any benifit from switching CPUs
would show up.  

FreeBSD may already do some of that, I've not checked.  

A deamon isn't enough for everyone, on some servers it will be good, but
others it is the wrong thing.  Povray for example is typically not run as
a deamon, and it typically will run long enough that intellegent CPU
switching will decrease the overall runtime.  There are others.

Of course I'm not offering to do the work, so whoever is going to gets to
decide if the above is worth the bother.  I can think of situations where
it won't matter and situations where it will.   If either is more then a
rarely encountered end case is an exercise left to the reader.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0107032151330.15604-100000>