aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/slab.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 583644f6ae11..2a3cbd6e675d 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3170,7 +3170,7 @@ static int __init failslab_debugfs(void)
3170 struct dentry *dir; 3170 struct dentry *dir;
3171 int err; 3171 int err;
3172 3172
3173 err = init_fault_attr_dentries(&failslab.attr, "failslab"); 3173 err = init_fault_attr_dentries(&failslab.attr, "failslab");
3174 if (err) 3174 if (err)
3175 return err; 3175 return err;
3176 dir = failslab.attr.dentries.dir; 3176 dir = failslab.attr.dentries.dir;
@@ -3208,9 +3208,6 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
3208 3208
3209 check_irq_off(); 3209 check_irq_off();
3210 3210
3211 if (should_failslab(cachep, flags))
3212 return NULL;
3213
3214 ac = cpu_cache_get(cachep); 3211 ac = cpu_cache_get(cachep);
3215 if (likely(ac->avail)) { 3212 if (likely(ac->avail)) {
3216 STATS_INC_ALLOCHIT(cachep); 3213 STATS_INC_ALLOCHIT(cachep);
@@ -3402,6 +3399,9 @@ __cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
3402 unsigned long save_flags; 3399 unsigned long save_flags;
3403 void *ptr; 3400 void *ptr;
3404 3401
3402 if (should_failslab(cachep, flags))
3403 return NULL;
3404
3405 cache_alloc_debugcheck_before(cachep, flags); 3405 cache_alloc_debugcheck_before(cachep, flags);
3406 local_irq_save(save_flags); 3406 local_irq_save(save_flags);
3407 3407
@@ -3472,6 +3472,9 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
3472 unsigned long save_flags; 3472 unsigned long save_flags;
3473 void *objp; 3473 void *objp;
3474 3474
3475 if (should_failslab(cachep, flags))
3476 return NULL;
3477
3475 cache_alloc_debugcheck_before(cachep, flags); 3478 cache_alloc_debugcheck_before(cachep, flags);
3476 local_irq_save(save_flags); 3479 local_irq_save(save_flags);
3477 objp = __do_cache_alloc(cachep, flags); 3480 objp = __do_cache_alloc(cachep, flags);