Subject: Re: Prototype kernel continuation-passing for NetBSD
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-kern
Date: 03/27/2004 13:50:31
In message <17FE38E2-802F-11D8-BEDA-000A957650EC@wasabisystems.com>,
Jason Thorpe writes:
>

>This is something I've been worried about... calling code not meant for 
>interrupt context from an interrupt context (e.g. a softint).
>
>If you start doing that, then everything that sosend touches has to be 
>protected with an appropriate spl.

Appreciated, but you don't need to worry. I experience with doing
this, and what's safe and what isn't, going back to 1999, with a
variety of 4.4-Lite derived systems.  sosend(), for PF_UNIX and
PF_INET sockets, can and will become safe: been there, got the T-shirt.

But your point is one reason why kcont (as originaly committed)
treated IPLs as ordered.  Defer to IPL_SPLSOFTNET [[or for the
paranoid, go lower, then raise IPL by calling splsoftnet() from the
continuation function]] and it turns out most of the 4.4-Lite
networking code is (with a few exceptions) safe to call.  As Bill
noted, some of the hairer issues pretty much have go away in any case,
for fine-grained SMP locking.

As you might guess from what I said to Matt, the region where I have
solid experience is a tad more conservative than Matt's approach; but
I'm willing to go either way.