Subject: Re: Is the netBSD kernel Preemptible ?
To: None <tech-smp@netbsd.org, tech-perform@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-smp
Date: 06/14/2002 18:56:20
[ On Friday, June 14, 2002 at 23:15:12 (+0100), David Laight wrote: ]
> Subject: Re: Is the netBSD kernel Preemptible ?
>
> > 
> > So, how exactly does an application level process go about the task of
> > preempting the kernel?
> 
> It can't - after all the kernel is already running the 'best' process.
> 
> What has to happen is either:
> 1) A process wakes up a higher priority process

A process can't (in unix) wake up another process -- it can only ask the
kernel to, and at that point it's the kernel which decides what runnable
process will actually run, not the signalling process.  (Unless some
extended API (system call) that I'm not aware of gives an application a
direct hook into the scheduler.)

> 2) An interrupt wakes up a higher priority process

A hardware interrupt, at least in Unix, can normally only "wake up" the
kernel so far as I know....

> (A timer interrupt might cause the scheduler to re-evaluate all
> the process priorities.)

You mean like a soft interrupt generated by a callout and thus
ultimately "triggered" by the clock tick hardware interrupt handler?

> On an SMP system an interrupt on one CPU might cause the scheduler
> to generate an inter-cpu interrupt to force a different cpu to
> process switch....

Hmmm... that's something I hadn't really thought deeply about (one CPU
interrupting another).  I've studied relatively few SMP hardware
architectures down to that level -- is such a capability commonly
available on modern multi-CPU systems?

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