summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2016-01-31 19:40:48 +0100
committerStephen Rothwell <sfr@canb.auug.org.au>2016-02-01 07:49:38 +1100
commit110012db00f3b7337b234cd6ef35d749b6ce60f0 (patch)
treef42ce3532c7f182054ad546b94f03024add89ef4
parentd7b1470e81393aff2121ee2f7831340bc0958f14 (diff)
downloadlinux-next-110012db00f3b7337b234cd6ef35d749b6ce60f0.tar.gz
mm: temporary fix for SLAB in linux-next
This is only for linux-next, until AKPM pickup fixes two patches: base url: http://ozlabs.org/~akpm/mmots/broken-out/ [1] mm-fault-inject-take-over-bootstrap-kmem_cache-check.patch [2] slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub.patch First fix is for compiling with CONFIG_FAILSLAB. The linux-next commit needing this fix is 074b6f53c320 ("mm: fault-inject take over bootstrap kmem_cache check"). 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>
-rw-r--r--mm/failslab.c1
-rw-r--r--mm/slab.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/mm/failslab.c b/mm/failslab.c
index 0c5b3f31f310..b0fac98cd938 100644
--- a/mm/failslab.c
+++ b/mm/failslab.c
@@ -1,5 +1,6 @@
#include <linux/fault-inject.h>
#include <linux/slab.h>
+#include <linux/mm.h>
#include "slab.h"
static struct {
diff --git a/mm/slab.c b/mm/slab.c
index e90d259b3242..ddd974e6b3bb 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3190,6 +3190,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;
@@ -3268,6 +3269,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;