Subject: Re: DIAGNOSTIC in -current
To: None <current-users@NetBSD.org>
From: Pavel Cahyna <pavel@NetBSD.org>
List: current-users
Date: 09/20/2006 16:57:47
On Wed, Sep 20, 2006 at 07:25:45AM -0700, Chuck Silvers wrote:
> DIAGNOSTIC used to be enabled in GENERIC on i386, but frank disabled it
> in this revision:
> 
> revision 1.403
> date: 2001/04/21 20:49:14;  author: fvdl;  state: Exp;  lines: +3 -3
> Move the DIAGNOSTIC option to a seperate config file, it's too expensive
> to be in GENERIC (which should be a kernel ready for production use).
> 
> 
> has the performance degradation caused by enabling DIAGNOSTIC been reduced
> sufficiently to no longer be a concern?  if not, then I'd think it would
> be worthwhile to investigate that before turning it on by default.

I think we should not care. The proposal was to turn off DIAGNOSTIC for
releases.

> also, I believe that currently DIAGNOSTIC is still treated by the LKM
> infrastructure as causing LKMs to be incompatible, even though this option
> no longer changes the kernel ABI after some changes I made at the end of
> last year.

How does this work? if DIAGNOSTIC is defined, free() apparently fills freed
memory with a known pattern and malloc() checks for it. If a LKM (not
compiled with DIAGNOSTIC) frees some memory with FREE() (which is a macro), 
and then the DIAGNOSTIC code will try to allocate this piece of memory, it
won't find the magic pattern and will panic. Or am I missing something?

Pavel