The patch titled Subject: mm: don't call should_failslab() for !CONFIG_FAILSLAB has been added to the -mm tree. Its filename is mm-dont-call-should_failslab-for-config_failslab.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-dont-call-should_failslab-for-config_failslab.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-dont-call-should_failslab-for-config_failslab.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jens Axboe <axboe@xxxxxxxxx> Subject: mm: don't call should_failslab() for !CONFIG_FAILSLAB Allocations can be a very hot path, and this out-of-line function call is noticeable. Link: https://lkml.kernel.org/r/e01e5e40-692a-519c-4cba-e3331f173c82@xxxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/fault-inject.h | 2 +- mm/slab.h | 2 ++ mm/slab_common.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) --- a/include/linux/fault-inject.h~mm-dont-call-should_failslab-for-config_failslab +++ a/include/linux/fault-inject.h @@ -64,8 +64,8 @@ static inline struct dentry *fault_creat struct kmem_cache; -int should_failslab(struct kmem_cache *s, gfp_t gfpflags); #ifdef CONFIG_FAILSLAB +int should_failslab(struct kmem_cache *s, gfp_t gfpflags); extern bool __should_failslab(struct kmem_cache *s, gfp_t gfpflags); #else static inline bool __should_failslab(struct kmem_cache *s, gfp_t gfpflags) --- a/mm/slab_common.c~mm-dont-call-should_failslab-for-config_failslab +++ a/mm/slab_common.c @@ -1323,6 +1323,7 @@ EXPORT_TRACEPOINT_SYMBOL(kmem_cache_allo EXPORT_TRACEPOINT_SYMBOL(kfree); EXPORT_TRACEPOINT_SYMBOL(kmem_cache_free); +#ifdef CONFIG_FAILSLAB int should_failslab(struct kmem_cache *s, gfp_t gfpflags) { if (__should_failslab(s, gfpflags)) @@ -1330,3 +1331,4 @@ int should_failslab(struct kmem_cache *s return 0; } ALLOW_ERROR_INJECTION(should_failslab, ERRNO); +#endif --- a/mm/slab.h~mm-dont-call-should_failslab-for-config_failslab +++ a/mm/slab.h @@ -491,8 +491,10 @@ static inline struct kmem_cache *slab_pr might_alloc(flags); +#ifdef CONFIG_FAILSLAB if (should_failslab(s, flags)) return NULL; +#endif if (!memcg_slab_pre_alloc_hook(s, objcgp, size, flags)) return NULL; _ Patches currently in -mm which might be from axboe@xxxxxxxxx are mm-dont-call-should_failslab-for-config_failslab.patch