summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2014-04-10 00:19:02 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-10 00:19:02 (GMT)
commit62df817484fe9ace2b769f251846d4f18a9b0479 (patch)
treed12ed3e25e61736a16ae16b5599d8af565575495 /mm
parent63ebbe8b3dfbf25e491260e102e71c52f49ca5bb (diff)
downloadlinux-fsl-qoriq-62df817484fe9ace2b769f251846d4f18a9b0479.tar.xz
slub: delay ctor until the object is requested
It seems that allocation of plenty objects causes latency on ARM since that code can not be preempted Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c
index b1c50f7..a164648 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1363,8 +1363,10 @@ static void setup_object(struct kmem_cache *s, struct page *page,
void *object)
{
setup_object_debug(s, page, object);
+#ifndef CONFIG_PREEMPT_RT_FULL
if (unlikely(s->ctor))
s->ctor(object);
+#endif
}
static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
@@ -2470,6 +2472,10 @@ redo:
if (unlikely(gfpflags & __GFP_ZERO) && object)
memset(object, 0, s->object_size);
+#ifdef CONFIG_PREEMPT_RT_FULL
+ if (unlikely(s->ctor) && object)
+ s->ctor(object);
+#endif
slab_post_alloc_hook(s, gfpflags, object);