From: Eric Dumazet Date: Sat, 3 Sep 2005 22:55:06 +0000 (-0700) Subject: [PATCH] mm/slab.c: prefetchw the start of new allocated objects X-Git-Tag: v2.6.14-rc1~952 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34342e863c3143640c031760140d640a06c6a5f8;p=linux-2.6 [PATCH] mm/slab.c: prefetchw the start of new allocated objects Mostobjects returned by __cache_alloc() will be written by the caller, (but not all callers want to write all the object, but just at the begining) prefetchw() tells the modern CPU to think about the future writes, ie start some memory transactions in advance. Signed-off-by: Eric Dumazet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slab.c b/mm/slab.c index 59d382fbca..75127a6f1f 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2166,7 +2166,9 @@ static inline void *__cache_alloc(kmem_cache_t *cachep, unsigned int __nocast fl objp = cache_alloc_refill(cachep, flags); } local_irq_restore(save_flags); - objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0)); + objp = cache_alloc_debugcheck_after(cachep, flags, objp, + __builtin_return_address(0)); + prefetchw(objp); return objp; }