]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub-fix
authorJesper Dangaard Brouer <brouer@redhat.com>
Tue, 9 Feb 2016 23:11:55 +0000 (10:11 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 9 Feb 2016 23:11:55 +0000 (10:11 +1100)
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 <brouer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/slab.c

index 17076da71a45168c1e9fe83cef0b4d71f9e8c89a..1857a652c92800f9a493c123f79dfcd8523d9ae7 100644 (file)
--- 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;