KVERIFY for non-debug invariants?
Robert Watson
rwatson at FreeBSD.org
Thu Dec 6 09:26:26 UTC 2012
On Wed, 5 Dec 2012, Vijay Singh wrote:
> All. KASSERT() is a really need way of expressing invariants when INVARIANTS
> is defined. However for regular, non-INVARIANTS code folks have the typical
> if() panic() combos, or private macros. Would a KVERIFY() that does this in
> non-INVARIANTS code make sense?
I'd certainly be fine with something like this. It might be worth posting to
arch@ with a code example, as hackers@ has a subset of the potentially
interested audience. INVARIANTS has got a bit heavier-weight over the years
-- the main thing I run into in higher-performance scenarios is its additional
UMA debugging, which causes a global lock to be acquired during sanity checks.
It might be worth our pondering adding a new configure option for particularly
slow invariant tests -- e.g., INVARIANTS_SLOW ... or maybe just
INVARIANTS_UMA. However, that's a different issue.
(I sort of feel that things labeled "assert" should be something we can turn
on in production... so maybe INVARIANTS/KASSERT mission-creep is the issue.)
Robert
More information about the freebsd-hackers
mailing list