Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20220605152539.3196045-2-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
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>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Daniel Vetter and committed by
akpm
a3967244 446ec838

-10
-10
mm/slab.c
··· 2958 2958 return ac->entry[--ac->avail]; 2959 2959 } 2960 2960 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 - 2967 2961 #if DEBUG 2968 2962 static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, 2969 2963 gfp_t flags, void *objp, unsigned long caller) ··· 3199 3205 if (unlikely(ptr)) 3200 3206 goto out_hooks; 3201 3207 3202 - cache_alloc_debugcheck_before(cachep, flags); 3203 3208 local_irq_save(save_flags); 3204 3209 3205 3210 if (nodeid == NUMA_NO_NODE) ··· 3283 3290 if (unlikely(objp)) 3284 3291 goto out; 3285 3292 3286 - cache_alloc_debugcheck_before(cachep, flags); 3287 3293 local_irq_save(save_flags); 3288 3294 objp = __do_cache_alloc(cachep, flags); 3289 3295 local_irq_restore(save_flags); ··· 3518 3526 s = slab_pre_alloc_hook(s, NULL, &objcg, size, flags); 3519 3527 if (!s) 3520 3528 return 0; 3521 - 3522 - cache_alloc_debugcheck_before(s, flags); 3523 3529 3524 3530 local_irq_disable(); 3525 3531 for (i = 0; i < size; i++) {