lkml.org 
[lkml]   [2011]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [x86] Fix prefetch instruction
On Fri, 5 Aug 2011, H. Peter Anvin wrote:

> On 08/05/2011 02:10 PM, Christoph Lameter wrote:
> >>
> >> Have you done any performance analysis on this versus the null case? I
> >> know there are some workloads where it helps, but if it hurts as many as
> >> it helps...
> >
> > No I have not. prefetch IMHO means that the cacheline is fetched early so
> > that the cacheline is fully available like any other to the code.
> > prefetchnta does fetch the cacheline too but its not treated like the other cacheline but
> > preferably thrown out again. Its a "streamfetch" designed for apps that
> > scan over large amounts of memory and want to avoid cache pollution.
> >
> > This is surprising to the end user as far as I can tell.
> >
>
> Right. However, Linus has brought up the hypothesis that prefetch might
> actually be a net loss on x86, because current x86 processors are
> generally doing a good job with prefetching in hardware. Directed
> prefetches can thus be a net minus.

This kinid of prefetch is a minus because the cache is evicted early. It
was prefetched with a special hint so its likely very important. That does
not seem to be very consistent and may cause regressions. Changing it to a
full prefetch would make the important cacheline stay longer in the cache.




\
 
 \ /
  Last update: 2011-08-06 01:35    [W:0.034 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site