Subject: Re: locore?
To: tech-kern@NetBSD.ORG, Chris Torek <>
From: Andrew Cagney <>
List: tech-kern
Date: 06/30/1995 15:01:26
Excerpts from mail: 29-Jun-95 Re: locore? Chris Torek@BSDI.COM (1515)

> >	IS - interrupt stack - a single stack for handling all interrupts

> Make this `a per CPU stack for handling interrupts' ... though if you
> have only one CPU, it works out the same.

Thanks.  Forgot that BSD 4.4 was `SMP ready' :-)

> >	if old state == user
> >		save on kernel stack (so ready for ast)

> For many (most?) machines, many (most?) interrupts will *not* result
> in an AST, so this would generally be wasted effort.  User state
> should probably be saved in whatever place is most convenient.  ASTs
> should generally be deferred until just before (or during) a return
> to user mode, and at that point the user state is generally pretty
> much restored anyway, so that an AST pseudo-trap can simply save it
> away as if it were a regular trap.


Attempting a speedup by always saving user context on the user thread's
kernel stack probably falls into the same category as trying to avoid
floating point registers in a context switch.  No one will really know
until someone tries it ...

			thanks, Andrew