Subject: Re: Is the netBSD kernel Preemptible ?
To: Gary Thorpe <gat7634@hotmail.com>
From: Greg A. Woods <woods@weird.com>
List: tech-perform
Date: 06/14/2002 15:00:23
[ On Friday, June 14, 2002 at 13:42:55 (-0400), Gary Thorpe wrote: ]
> Subject: Re: Is the netBSD kernel Preemptible ?
>
> I recently asked a related question on tech-kern (or tech-smp?) about 
> whether or not it was necessary to write device driver code with 
> locks/synchronization stuff. Since there is a huge amount of code which will 
> need to be changed to add reentrancy/premption (sprinkled everywhere in a 
> monolithic kernel), I do not think developers should wait for SMP to arrive, 
> because then the necessary framework to have it working well will be playing 
> catch-up and NetBSD will go through the same thing FreeBSD and Linux are 
> still going through.

I'll go out on a limb here (since I don't have any experience yet with
NetBSD's SMP kernel implementation) and say that since device drivers
are merely subroutines called by the kernel at appropriate places that
it should not be necessary to do anything to make them SMP compatible
unless they reach back into bits of kernel storage that does have SMP
interlock requirements.  I.e. if a driver is well behaved and just does
hardware manipulation then it should be fine.  Of course most drivers do
need to call some kernel subroutines, and so those routines must be made
SMP compatible (assuming they might manipulate shared storage).
Unfortunately I don't believe there's yet a well defined Device Driver
Kernel Interface specification so it's hard to know whether all the
necessary routines are SMP compatible and whether or not a given driver
is DDK compliant (and thus implicitly SMP compatible or not).

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>