On 6/18/20 12:10 PM, Vlastimil Babka wrote: > ----8<---- > From b8df607d92b37e5329ce7bda62b2b364cc249893 Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka <vbabka@xxxxxxx> > Date: Thu, 18 Jun 2020 11:52:03 +0200 > Subject: [PATCH] mm, slab/slub: improve error reporting and overhead of > cache_from_obj() > Another small fixup, please. ----8<---- >From 2cd24408828a22a3cd4301afbaf98767b1a14eb1 Mon Sep 17 00:00:00 2001 From: Vlastimil Babka <vbabka@xxxxxxx> Date: Wed, 24 Jun 2020 09:49:15 +0200 Subject: [PATCH] mm, slab/slub: improve error reporting and overhead of cache_from_obj()-fix The added VM_WARN_ON_ONCE triggers [1] with CONFIG_SLAB, as SLAB_DEBUG_FLAGS doesn't include SLAB_CONSISTENCY_CHECKS. Move the check under #ifdef SLUB_DEBUG. [1] https://lore.kernel.org/r/20200623090213.GW5535@shao2-debian Reported-by: kernel test robot <rong.a.chen@xxxxxxxxx> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> --- mm/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slab.h b/mm/slab.h index 525260217013..e829d9f5e6ef 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -229,8 +229,8 @@ static inline void print_tracking(struct kmem_cache *s, void *object) */ static inline bool kmem_cache_debug_flags(struct kmem_cache *s, slab_flags_t flags) { - VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS)); #ifdef CONFIG_SLUB_DEBUG + VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS)); if (static_branch_unlikely(&slub_debug_enabled)) return s->flags & flags; #endif -- 2.27.0