svn commit: r244112 - head/sys/kern

Andriy Gapon avg at FreeBSD.org
Thu Dec 13 06:51:25 UTC 2012


on 13/12/2012 00:43 Adrian Chadd said the following:
> On 12 December 2012 14:33, Andriy Gapon <avg at freebsd.org> wrote:
> 
>>> Yes, two of my employers were more of "we want to get more debug metrics, we
>>> have the spare cycles, but we can't deal with superfluous panics".
>>>
>>> It also allows us "non-architects" to slip in a debug image when we have spare
>>> cpu without getting yelled at for "crashing the $foo".
>>
>> There is clearly something wrong with this sort of mentality.
>>
>> If you find instances where a developer put panic(9) (or KASSERT or etc) to mean
>> "maybe here is a bug, let's just panic", then let's get those things fixed.
>>
>> But most of assertions in our code that are know to me really mean that a real
>> bug has already occurred, that portions of kernel state are corrupted and there
>> is no going back to a sane state, only going forward to corrupting more and more.
> 
> Dude, if you're running -STABLE right now, you don't have invariants
> enabled and you aren't checking for them.
> So right now, as it stands, large swaths of our kernel code are
> falling afoul of what you're calling Alfred out on.

Pal, it's because there are people who thoroughly and regularly test code with
INVARIANTS that the code with or without INVARIANTS does not crash as often as
it could.  When I tested the code with INVARIANTS I trust it to run without
those and if a user get a mystery panic one of the first things to advise is to
enable various debugging options.

> Before you all reply, please review and understand the difference
> between "panic()" and "KASSERT()". panic() is not being changed here.
> KASSERT() is what's being changed here. panic() is not optional.
> KASSERT() is. With a non-INVARIANTS kernel, we _are not checking
> invariants_ and we are continuing to run _after_ said non-compiled-in
> invariants. With this in mind, please re-review this. :-)

KASSERT is not optional contrary to your opinion.
We elect to not compile it in for performance reasons, but it is not optional
when it is compiled in.

-- 
Andriy Gapon


More information about the svn-src-head mailing list