[lkml]   [2005]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] mm/slab.c : prefetchw the start of new allocated objects
[MM] slab.c : prefetchw the start of new allocated objects

Most of objects 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.

Some CPU lacks a prefetchw() and currently do nothing, so I ask this question :
Should'nt make prefetchw() do at least a prefetch() ? A read hint is better than nothing.

Signed-off-by: Eric Dumazet <>

diff -Nru linux-2.6.13-rc4/mm/slab.c linux-2.6.13-rc4-ed/mm/slab.c
--- linux-2.6.13-rc4/mm/slab.c 2005-07-29 00:44:44.000000000 +0200
+++ linux-2.6.13-rc4-ed/mm/slab.c 2005-07-29 10:48:45.000000000 +0200
@@ -2166,6 +2166,7 @@
objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0));
+ prefetchw(objp);
return objp;
 \ /
  Last update: 2005-07-29 11:10    [W:0.062 / U:1.416 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site