<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.linux-mips.org/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.linux-mips.org/wiki?title=Prefetching&amp;feed=atom&amp;action=history</id>
		<title>Prefetching - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.linux-mips.org/wiki?title=Prefetching&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://www.linux-mips.org/wiki?title=Prefetching&amp;action=history"/>
		<updated>2013-05-19T10:04:57Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>//www.linux-mips.org/wiki?title=Prefetching&amp;diff=6359&amp;oldid=prev</id>
		<title>Ralf: Explain Linux's use of prefetching</title>
		<link rel="alternate" type="text/html" href="http://www.linux-mips.org/wiki?title=Prefetching&amp;diff=6359&amp;oldid=prev"/>
				<updated>2005-12-05T17:03:38Z</updated>
		
		<summary type="html">&lt;p&gt;Explain Linux&amp;#039;s use of prefetching&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;There are basically three types of uses of prefetch instructions in the kernel:&lt;br /&gt;
&lt;br /&gt;
* Prefetching data structures as done by chained list walking macros and similar.&amp;lt;br&amp;gt;Linux uses 'Prefetch for Load' (hint 0) if CONFIG_HAS_PREFETCH is defined for a particular configuration.&lt;br /&gt;
* Prefetching in memcpy&amp;lt;br&amp;gt;Linux will use prefetch hints 0 and 1 - but currently only on cache coherent platforms.&lt;br /&gt;
* Prefetching in copy_page / clear_page&amp;lt;br&amp;gt;These functions are generated at runtime and Linux has detailed knowledge about which processors have a useful prefetch implementation:&lt;br /&gt;
** [[R4000]] and [[R4400]]:&amp;lt;br&amp;gt;These processors don't have prefetch instructions but Linux uses the CreateDirtyExclusive cacheop to achieve the same effect as ''PrepareForStore'', so it should probably be mentioned here.&lt;br /&gt;
** [[R5000]] and many variants&amp;lt;br&amp;gt;While this processor has a prefetch instruction it's a nop, so would only harm performance.  Linux therefore will not use prefetching.&lt;br /&gt;
** [[R10000]], [[R12000]], [[RM9000]]&amp;lt;br&amp;gt;Linux uses 'LoadStreamed' (hint 4) and 'StoreStreamed' (hint 5).  In case of the RM9000 this is due to a processor bug in early revisions.&lt;br /&gt;
** All others&amp;lt;br&amp;gt;''LoadStreamed'' (hint 4) and ''PrepareForStore'' (hint 30).&lt;br /&gt;
&lt;br /&gt;
== Userspace use of prefetching ==&lt;br /&gt;
The kernel has no control over the use of prefetch instructions in userspace, so it is upto applications to make proper use of prefetching in situations and on hardware where this is expected to result in a performance gain.  &lt;br /&gt;
&lt;br /&gt;
Gcc can prefetch large arrays if enabled ''-fprefetch-loop-arrays''.  This option is disabled by ''-Os''.&lt;/div&gt;</summary>
		<author><name>Ralf</name></author>	</entry>

	</feed>