- In getpages don't allocate if we are not locked
- Use kmem_alloc instead of malloc and don't sleep
Also provide a 64 entry stack array so we don't have to allocate in the
common case.
path for all args except the first. So "which cp vi" found /bin/cp
using the first entry in the path, but failed to find /usr/bin/vi
using the second entry in the path, although "whereis cp vi" worked.
Restoring the ":" was done in the wrong place.
Also fix a bug in which an arg beginning with "/" would cause all
subsequent args to be ignored. A "break" should have been "continue".
Add comments to all break and continue statements saying what they are
intended to do.
Also add braces around the body of a for loop which contained only one
multi-line statement.
and libnetinet into a big bunch for now. If they were separate
libraries, the DOMAIN_DEFINE() in the latter on the linkline would
not get noticed at "boot" time because of the abovementioned
brokenness. One of these days I'll add code to dlopen() the
libraries and resplit them, but this will allow things to work
until then.
walk the list, we're looking for a vp to do something with. We do
this in the signal code and in the timer code. The signal code already
runs with proc::p_lock held, so it's a very natural lock to use. The
timer code, however, calls into the sa timer code with a spinlock held.
Since proc::p_lock is an adaptable mutex, we can sleep to get it. Sleeping
with a spinlock is BAD. So proc::p_lock is _not_ the right lock there,
and something like sadata::sa_mutex would be best.
Address this difficulty by noting that both uses actually just read
the list. Changing the list of VPs is rare - once one's added, it stays
until the process ends. So make the locking protocol that to write the
list you have to hold both proc::p_lock and sadata::sa_mutex (taken
in that order). Thus holding either one individually grants read access.
This removes a case where we could sleep with timer_lock, a spinlock at
IPL_SCHED (!!), while trying to get p_lock. If that ever happened, we'd
pretty much be dead. So don't do that!
This fixes a merge botch from how I handled our gaining p_lock - p_lock
should not have simply replaced p_smutex.
While here, tweak the sa_unblock_userret() code for the case
when the blessed vp is actually running (on another CPU). Make its
resched RESCHED_IMMED so we whack the CPU. Addresses a hang I've
observed in starting firefox on occasion when I see one thread running
in userland and another thread sitting in lwpublk, which means it's on
the list of threads for which we need an unblocked upcall. This list is
one on which things should NOT linger.
the ioctl, not return random garbage. It returning random garbage
causes an interface with an interesting netmask to get set and
hence a very interesting effect when you try to add a route for
your system.
All in all, a very healthy debugging session (if you're a vampire
or a wraith).
in a suitable ifdef, so things still compile if STATIC is defined as
"static", which is for some reason not the default.
(In the long run STATIC should go away - it might have once been a
portability hack but now definitely serves no purpose.)