Re: [x86] Fix prefetch instruction

From: H. Peter Anvin
Date: Fri Aug 05 2011 - 19:53:58 EST


On 08/05/2011 04:32 PM, Christoph Lameter wrote:
>>
>> 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.
>

The argument applies not just to NTA prefetches, though. There is a
pipeline cost to performing the software prefetch action, it can cause
evictions if the data is not used, and it can increase TLB pressure.

As such, it would be very interesting to know if prefetch0 or nothing is
the better; agree we shouldn't nta here.

-hpa


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/