diff --git a/[refs] b/[refs] index 3894f289a00f..8fd25a44cf74 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 42c8c99cd891184bf4bcf6f09d62c54e42599453 +refs/heads/master: 0ad9500e16fe24aa55809a2b00e0d2d0e658fc71 diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 4907563ef7ff..5b915e86a9b0 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -269,6 +269,11 @@ static inline void *get_freepointer(struct kmem_cache *s, void *object) return *(void **)(object + s->offset); } +static void prefetch_freepointer(const struct kmem_cache *s, void *object) +{ + prefetch(object + s->offset); +} + static inline void *get_freepointer_safe(struct kmem_cache *s, void *object) { void *p; @@ -2309,6 +2314,8 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, object = __slab_alloc(s, gfpflags, node, addr, c); else { + void *next_object = get_freepointer_safe(s, object); + /* * The cmpxchg will only match if there was no additional * operation and if we are on the right processor. @@ -2324,11 +2331,12 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, if (unlikely(!this_cpu_cmpxchg_double( s->cpu_slab->freelist, s->cpu_slab->tid, object, tid, - get_freepointer_safe(s, object), next_tid(tid)))) { + next_object, next_tid(tid)))) { note_cmpxchg_failure("slab_alloc", s, tid); goto redo; } + prefetch_freepointer(s, next_object); stat(s, ALLOC_FASTPATH); }