*BSD News Article 33890


Return to BSD News archive

Xref: sserve comp.os.386bsd.misc:3041 comp.os.linux.misc:21157
Newsgroups: comp.os.386bsd.misc,comp.os.linux.misc
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!gatech!swrinde!cs.utexas.edu!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder.parcplace.com!imp
From: imp@boulder.parcplace.com (Warner Losh)
Subject: Re: Usefulness of BSD/Linux Source Knowledge (was BSD vs. LINUX)
Message-ID: <Cu2ny3.J9o@boulder.parcplace.com>
Sender: news@boulder.parcplace.com
Organization: ParcPlace Boulder
References: <Ctv7KA.Jy9@news.cern.ch> <31mfon$efs@glitnir.ifi.uio.no> <31racs$si2@nyheter.chalmers.se>
Date: Fri, 5 Aug 1994 17:15:39 GMT
Lines: 45

In article <31racs$si2@nyheter.chalmers.se> tl@cd.chalmers.se
(Torbj|rn Lindgren) writes: 
>Adding SMP was prrobably rather easy. Just put a big lock on the whole
>kernel... This means that only one process (or thread) can be in the
>kernel in the kernel a given time, but if that process can run on any
>processor you have a SMP (per definition, symmetric means that either
>processor may run kernel tasks, not that more than one process may be
>in the kernel).

What you describe is ASMP.  With ASMP, you must block until the
"Master" CPU is ready to process your kernel request, where with you
suggestion, you must wait for the current CPU to finish being in the
kernel.  It sounds like you have a floating Master CPU.  A SMP kernel,
btw, means that you can have multiple processes in the kernel
concurrently and not more than one of them is accessing the same
criticial structures at the same time.  So one could be servicing a
serial line interrupt while the other one is blitting stuff to a
remote X server.

>Creating a system where more than one process can be in the kernel at
>a give time is *much* harder, and SunOS 4.x doesn't support this (This
>is one of the major differences between SunOS 4 and Solaris 2). The
>main difference is that you have to use data-locks (lock the
>data-structures you use) instead of a big lock.

Solbourne did this with 4.0.x and 4.1.x kernels from Sun.  It took
them a fair abount of time to convert the kernel to the fine grain
locking.  I'd think it would take about three months to get a fairly
stable SMP kernel, and another six months to get out all the lock
related crashes that happen from time to time.  Deadlock is a real
problem and locks must always be taken out in the same order to
prevent deadlock (which usually shows up in most SMP systems as
something like "spin lock timeout" or something like that).  Race
conditions abound and need to be carefully looked at, rather than just
hacked together.

SMP on the Solbourne machines bought us about 10% in a 3 CPU
configuration over the ASMP kernel that we were running previously.
Both these kernels were based on 4.0.3.

Warner
-- 
Warner Losh		imp@boulder.parcplace.COM	ParcPlace Boulder
"... but I can't promote you to "Prima Donna" unless you demonstrate a few
 more serious personality disorders"