From f469a03d7082035d685b5934992f043ccdd6eadf Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Wed, 10 Feb 2016 10:11:55 +1100 Subject: [PATCH] slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub-fix Second fix is for correct masking of allowed GFP flags (gfp_allowed_mask), in SLAB allocator. This triggered a WARN, by percpu_init_late -> pcpu_mem_zalloc invoking kzalloc with GFP_KERNEL flags. The linux-next commit needing this fix is a1fd55538cae ("slab: use slab_pre_alloc_hook in SLAB allocator shared with SLUB"). Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Andrew Morton --- mm/slab.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/slab.c b/mm/slab.c index 17076da71a45..1857a652c928 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3143,6 +3143,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, void *ptr; int slab_node = numa_mem_id(); + flags &= gfp_allowed_mask; cachep = slab_pre_alloc_hook(cachep, flags); if (unlikely(!cachep)) return NULL; @@ -3226,6 +3227,7 @@ slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller) unsigned long save_flags; void *objp; + flags &= gfp_allowed_mask; cachep = slab_pre_alloc_hook(cachep, flags); if (unlikely(!cachep)) return NULL; -- 2.39.5