Commit Graph

6 Commits

Author SHA1 Message Date
ozaki-r
8db944330d Add a new sanity check to psref
It checks if a target being acquired is already acquired with
the same psref. It is usable but not lightweight, so enabled
only if DEBUG.
2016-11-09 09:00:46 +00:00
ozaki-r
8941dc1184 Fix an assertion in _psref_held
The assertion, psref->psref_lwp == curlwp, is valid only if the target
is held by the caller.

Reviewed by riastradh@
2016-10-28 07:27:52 +00:00
riastradh
421ddf539c Split psref_held into internal and public variants.
For internal use, we expect psrefs to be held by other LWPs when
asking in the cross-call thread whether the target in question is
referenced.

For public use, the caller should not assert about some other LWP
holding a psref.

But the rest of the logic is the same.
2016-04-13 08:31:00 +00:00
riastradh
135e13ec80 Back out previous -- <sys/intr.h> does provide splraiseipl.
Man page says <sys/param.h>, but that's wrong.

The real problem was that rump didn't have splraiseipl at all, and
that already got fixed before I woke up this morning and panicked
because I had obviously broken all the builds!
2016-04-11 13:52:23 +00:00
riastradh
4501fcf7e7 Need <sys/param.h> for splraiseipl.
How did this pass the releng autobuilds before?  We went through
several full builds of HEAD after I committed subr_psref.c.
2016-04-11 13:18:13 +00:00
riastradh
c03dceb184 Add passive references, intermediate between pserialize and refcount.
Discussed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2016/01/24/msg020069.html

API is still experimental and likely to change.  (Obvious changes:
either remove extra arguments everywhere, or shrink psref_target to a
single bit, at the expense of possibly valuable diagnostic checks.)
Should do some real testing before we use this in anger!
2016-04-09 06:21:16 +00:00