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:
Code that writes to a buffer after it is freed
Code using memory before it is initialized
Code that writes past the end of a buffer
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.
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.