Skip to content

Commit a396724

Browse files
danvetakpm00
authored andcommitted
mm/slab: delete cache_alloc_debugcheck_before()
It only does a might_sleep_if(GFP_RECLAIM) check, which is already covered by the might_alloc() in slab_pre_alloc_hook(). And all callers of cache_alloc_debugcheck_before() call that beforehand already. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Daniel Vetter <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Roman Gushchin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 446ec83 commit a396724

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

mm/slab.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,12 +2958,6 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
29582958
return ac->entry[--ac->avail];
29592959
}
29602960

2961-
static inline void cache_alloc_debugcheck_before(struct kmem_cache *cachep,
2962-
gfp_t flags)
2963-
{
2964-
might_sleep_if(gfpflags_allow_blocking(flags));
2965-
}
2966-
29672961
#if DEBUG
29682962
static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
29692963
gfp_t flags, void *objp, unsigned long caller)
@@ -3205,7 +3199,6 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_
32053199
if (unlikely(ptr))
32063200
goto out_hooks;
32073201

3208-
cache_alloc_debugcheck_before(cachep, flags);
32093202
local_irq_save(save_flags);
32103203

32113204
if (nodeid == NUMA_NO_NODE)
@@ -3290,7 +3283,6 @@ slab_alloc(struct kmem_cache *cachep, struct list_lru *lru, gfp_t flags,
32903283
if (unlikely(objp))
32913284
goto out;
32923285

3293-
cache_alloc_debugcheck_before(cachep, flags);
32943286
local_irq_save(save_flags);
32953287
objp = __do_cache_alloc(cachep, flags);
32963288
local_irq_restore(save_flags);
@@ -3527,8 +3519,6 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,
35273519
if (!s)
35283520
return 0;
35293521

3530-
cache_alloc_debugcheck_before(s, flags);
3531-
35323522
local_irq_disable();
35333523
for (i = 0; i < size; i++) {
35343524
void *objp = kfence_alloc(s, s->object_size, flags) ?: __do_cache_alloc(s, flags);

0 commit comments

Comments
 (0)