Writing Device Drivers

kmem_flags

kmem_flags is a kernel variable used to enable debugging features in the kernel's memory allocator. Setting kmem_flags to 0xf enables the allocator's debugging features. These include runtime checks to find:

The "Debugging With the Kernel Memory Allocator" in the Solaris Modular Debugger Guide describes how the kernel memory allocator can be used to determine the root cause of these problems.


Note -

Testing and developing with kmem_flags set to 0xf is extremely valuable since it can detect latent memory corruption bugs. Because setting kmem_flags to 0xf changes the internal behavior of the kernel memory allocator, it remains important to thoroughly test without kmem_flags as well.