aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2014-12-10 18:42:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:04 -0500
commitc871ac4e9666ad68ae861172ef8a7f73d6e61b26 (patch)
tree4ca2000cf5e0c663f1b70efadf38127fa7b59b7c /mm/slab.c
parentf6edde9cbe0634e4391b6e421a609ca3f57f6c38 (diff)
slab: improve checking for invalid gfp_flags
The code goes BUG, but doesn't tell us which bits were unexpectedly set. Print that out. Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index a2152a2573dd..79e15f0a2a6e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2590,7 +2590,10 @@ static int cache_grow(struct kmem_cache *cachep,
2590 * Be lazy and only check for valid flags here, keeping it out of the 2590 * Be lazy and only check for valid flags here, keeping it out of the
2591 * critical path in kmem_cache_alloc(). 2591 * critical path in kmem_cache_alloc().
2592 */ 2592 */
2593 BUG_ON(flags & GFP_SLAB_BUG_MASK); 2593 if (unlikely(flags & GFP_SLAB_BUG_MASK)) {
2594 pr_emerg("gfp: %u\n", flags & GFP_SLAB_BUG_MASK);
2595 BUG();
2596 }
2594 local_flags = flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK); 2597 local_flags = flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK);
2595 2598
2596 /* Take the node list lock to change the colour_next on this node */ 2599 /* Take the node list lock to change the colour_next on this node */