LWN.net Logo

Prefetching considered harmful

Prefetching considered harmful

Posted Sep 10, 2010 12:22 UTC (Fri) by nwatkins (subscriber, #61119)
Parent article: Prefetching considered harmful

In the linked list example used in the article, the author seems to be implying that modern processors "already prefetch everything they can get their hands on", and that the prefetch annotation isn't necessary.

Is there an underlying assumption for the linked list case that the items in the list are near each other in memory, or is there additional help from the compiler that marks memory for the next node? I'm not coming up with a mechanism which would allow the processor to understand the structure of the list.


(Log in to post comments)

Prefetching considered harmful

Posted Sep 10, 2010 16:20 UTC (Fri) by jzbiciak (✭ supporter ✭, #5246) [Link]

It's more likely that a modern CPU will speculate ahead to the next iteration of the loop, which will start to bring in the next structure in the list.

Prefetching considered harmful

Posted Sep 10, 2010 22:51 UTC (Fri) by daglwn (subscriber, #65432) [Link]

Soon the data items will not even need to be that close to each other. Google "region prefetching" for some articles.

We have to use those billions of transistors for something

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds