diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2015-06-18 18:16:13 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-06-18 18:16:13 -0400 |
commit | f3d06f313ad95095259352d001f017b924a416ed (patch) | |
tree | d711e615c18e950a9ccfacd84ce077f472514bb4 /mm/slub.c | |
parent | e718326ae200033775e1c58aa4bead1305dd6e2c (diff) | |
download | linux-rt-f3d06f313ad95095259352d001f017b924a416ed.tar.gz |
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>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c index 534609a0326a..72bb06beaabc 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1376,8 +1376,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) @@ -2499,6 +2501,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); |