tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



"Maxime Villard" <maxv%netbsd.org@localhost> writes:

> Module Name:  src
> Committed By: maxv
> Date:         Tue Jul 22 07:38:41 UTC 2014
>
> Modified Files:
>       src/sys/kern: subr_kmem.c
>
> Log Message:
> Enable KMEM_REDZONE on DIAGNOSTIC. It will try to catch overflows.
>
> No comment on tech-kern@

I didn't see this on tech-kern (nor did I see anything about defining
KMEM_POISON), and now that I'm aware I object.

DIAGNOSTIC, by longstanding tradition, is a lightweight and not have a
significant performance hit.  Basically it's about KASSERT of things
that must be true.  This is changing the size of memory allocations,
which is far more far-reaching.

I am not claiming that KMEM_REDZONE is not useful.   Arguably it could
be enabled under DEBUG, which is documented to be expensive (and
unreasonable to use on a normal basis).  DIAGNOSTIC, on the other hand,
I consider normal for systems that are being used (rather than only
debug targets).

The same goes for KMEM_POISON; these checks, while useful for debugging
(and it would be nice to have regular anita runs with DEBUG), are too
expensive for ordinary use.

For -current, GENERIC defines DIAGNOSTIC.

Please revert the automatic definition of these or change to DEBUG.
(I am not objecting to the separating and spiffing up of these features,
just that they are enabled when DIAGNOSTIC is defined.)

Attachment: pgpbk71GZJiKc.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index