diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2005-09-03 18:55:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:48 -0400 |
commit | 34342e863c3143640c031760140d640a06c6a5f8 (patch) | |
tree | f2855e8ca82929859cb1fe249982b3ba1ccf9b5e | |
parent | 61e06037e764337da39dff307cbcdbe9cf288349 (diff) |
[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 <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | mm/slab.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2166,7 +2166,9 @@ static inline void *__cache_alloc(kmem_cache_t *cachep, unsigned int __nocast fl | |||
2166 | objp = cache_alloc_refill(cachep, flags); | 2166 | objp = cache_alloc_refill(cachep, flags); |
2167 | } | 2167 | } |
2168 | local_irq_restore(save_flags); | 2168 | local_irq_restore(save_flags); |
2169 | objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0)); | 2169 | objp = cache_alloc_debugcheck_after(cachep, flags, objp, |
2170 | __builtin_return_address(0)); | ||
2171 | prefetchw(objp); | ||
2170 | return objp; | 2172 | return objp; |
2171 | } | 2173 | } |
2172 | 2174 | ||