On Fri, 21 May 2010, Christoph Lameter wrote: > Index: linux-2.6/mm/slub.c > =================================================================== > --- linux-2.6.orig/mm/slub.c 2010-04-27 12:41:05.000000000 -0500 > +++ linux-2.6/mm/slub.c 2010-04-27 13:15:32.000000000 -0500 > @@ -107,11 +107,17 @@ > * the fast path and disables lockless freelists. > */ > > +#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ > + SLAB_TRACE | SLAB_DEBUG_FREE) > + > +static inline int debug_on(struct kmem_cache *s) > +{ > #ifdef CONFIG_SLUB_DEBUG > -#define SLABDEBUG 1 > + return unlikely(s->flags & SLAB_DEBUG_FLAGS); > #else > -#define SLABDEBUG 0 > + return 0; > #endif > +} > > /* > * Issues still to be resolved: Nice optimization! I'd recommend a non-generic name for this check, though, such as cache_debug_on(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>