From: Ravikiran G Thirumalai Fix oops due to alien cache lockdep annotation on non NUMA configurations. A plain alien != NULL won't work as l3->alien is initialized with 0x01020304ul Signed-off-by: Ravikiran Thirumalai Cc: Shai Fultheim Cc: Thomas Gleixner Cc: Arjan van de Ven Cc: Ingo Molnar Cc: Pekka Enberg Cc: Christoph Lameter Signed-off-by: Andrew Morton --- mm/slab.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff -puN mm/slab.c~slab-fix-lockdep-warnings-fix mm/slab.c --- a/mm/slab.c~slab-fix-lockdep-warnings-fix +++ a/mm/slab.c @@ -674,6 +674,8 @@ static struct kmem_cache cache_cache = { #endif }; +#define BAD_ALIEN_MAGIC 0x01020304ul + #ifdef CONFIG_LOCKDEP /* @@ -705,7 +707,14 @@ static inline void init_lock_keys(void) continue; lockdep_set_class(&l3->list_lock, &on_slab_l3_key); alc = l3->alien; - if (!alc) + /* + * FIXME: This check for BAD_ALIEN_MAGIC + * should go away when common slab code is taught to + * work even without alien caches. + * Currently, non NUMA code returns BAD_ALIEN_MAGIC + * for alloc_alien_cache, + */ + if (!alc || (unsigned long)alc == BAD_ALIEN_MAGIC) continue; for_each_node(r) { if (alc[r]) @@ -1111,7 +1120,7 @@ static inline int cache_free_alien(struc static inline struct array_cache **alloc_alien_cache(int node, int limit) { - return (struct array_cache **) 0x01020304ul; + return (struct array_cache **)BAD_ALIEN_MAGIC; } static inline void free_alien_cache(struct array_cache **ac_ptr) _