On 08/02/2013 04:03 PM, Christos wrote: > On 08/02/2013 03:27 PM, Andrew Haley wrote: >> __builtin_prefetch() is what you need. However, there's no way you'll >> be able to lock anything in L1: it'll be evicted very shortly >> afterwards. Andrew. > > Sorry for that, but from what I see __builtin_prefetch() just fetches in > advance the related pages but it does not guarantee that thy won't be > thrown out of the cache. Right. > I want to know if there is some way to prefetch > and lock some memory unit in cache. There isn't. > I'm pretty sure that there should be > a way for this to be done in assembly, Why do you think so? I'm looking at http://download.intel.com/products/processor/manual/253668.pdf and I can't see it. Andrew.