All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-dont-call-should_failslab-for-config_failslab.patch added to -mm tree
@ 2021-10-05 21:19 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-10-05 21:19 UTC (permalink / raw)
  To: axboe, cl, iamjoonsoo.kim, mm-commits, penberg, rientjes, vbabka


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@kernel.dk>
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@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@kernel.dk are

mm-dont-call-should_failslab-for-config_failslab.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-05 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 21:19 + mm-dont-call-should_failslab-for-config_failslab.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.