From owner-freebsd-smp Thu Jul 5 8:37:35 2001 Delivered-To: freebsd-smp@freebsd.org Received: from mailhost.iprg.nokia.com (mailhost.iprg.nokia.com [205.226.5.12]) by hub.freebsd.org (Postfix) with ESMTP id 83BA937B403 for ; Thu, 5 Jul 2001 08:37:31 -0700 (PDT) (envelope-from michaelw@iprg.nokia.com) Received: from darkstar.iprg.nokia.com (darkstar.iprg.nokia.com [205.226.5.69]) by mailhost.iprg.nokia.com (8.9.3/8.9.3-GLGS) with ESMTP id IAA24225; Thu, 5 Jul 2001 08:37:30 -0700 (PDT) Received: (from root@localhost) by darkstar.iprg.nokia.com (8.11.0/8.11.0-DARKSTAR) id f65FbUa00817; Thu, 5 Jul 2001 08:37:30 -0700 X-mProtect: Thu, 5 Jul 2001 08:37:30 -0700 Nokia Silicon Valley Messaging Protection Received: from UNKNOWN (205.226.7.105, claiming to be "iprg.nokia.com") by darkstar.iprg.nokia.com(P1.5 smtpd2SaBOu; Thu, 05 Jul 2001 08:37:28 PDT Message-ID: <3B44894F.BD90890F@iprg.nokia.com> Date: Thu, 05 Jul 2001 08:35:43 -0700 From: Michael Williams Organization: Nokia X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: Henry Miller Cc: "E.B. Dreger" , smp@FreeBSD.ORG Subject: Re: per cpu runqueues, cpu affinity and cpu binding. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Yes, how about leaving the decisions on scheduling algorithms (including affinity) until later when the cost of thread/CPU switching is known (i.e. do the work to compute the cycle count.) Then iterate between development phases of improving the time+cache burden, and modifying the thread/process scheduling criterion. From Henry's point I glean that once switching gets to be a "significant" factor in the overall system load, the meaning of "fairness" could change. Regarding daemons, I think there are different classes of daemons. Because they are long lived doesn't really say much about their workload, working set, needs for scheduling, and priority versus other processes and daemons. Michael Henry Miller wrote: > 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message