<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: To MMU or not to MMU?</title>
	<atom:link href="http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/</link>
	<description>Shedding Light on the Hidden World of Embedded Systems</description>
	<lastBuildDate>Mon, 28 Jul 2014 16:18:37 -0400</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: BP</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-123953</link>
		<dc:creator>BP</dc:creator>
		<pubDate>Wed, 02 Oct 2013 22:26:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-123953</guid>
		<description>All MMU entries can be locked.  Also, most MMU tables do not have to be several levels deep.  It is entirely possible to fit an entire system description within the TLB (translation look-aside buffer).  It is also possible to write embedded software in C++.  It is just more complex.  I think that the arguments are the same; with perhaps more benefits to use an MMU.  Perhaps when people say MMU, they believe that it must have &#039;page faults&#039;, etc.  The only time the &#039;page fault&#039; should occur in a statically configured embedded system is when some code is not addressing memory that it owns.  It is also quite easy to lock the MMU entries in the interrupt path.  Too bad people seem so negative about this post.  Thanks for trying Robert.</description>
		<content:encoded><![CDATA[<p>All MMU entries can be locked.  Also, most MMU tables do not have to be several levels deep.  It is entirely possible to fit an entire system description within the TLB (translation look-aside buffer).  It is also possible to write embedded software in C++.  It is just more complex.  I think that the arguments are the same; with perhaps more benefits to use an MMU.  Perhaps when people say MMU, they believe that it must have &#8216;page faults&#8217;, etc.  The only time the &#8216;page fault&#8217; should occur in a statically configured embedded system is when some code is not addressing memory that it owns.  It is also quite easy to lock the MMU entries in the interrupt path.  Too bad people seem so negative about this post.  Thanks for trying Robert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: true_toyou</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-20888</link>
		<dc:creator>true_toyou</dc:creator>
		<pubDate>Sat, 11 Aug 2012 09:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-20888</guid>
		<description>how about use MMU+Dcache?
as you know, when the MMU is disabled, the Dcache also couldn&#039;t be used.  So if we use the MMU, and enable the Dcache, will the performance be better than no MMU and no Dcache?</description>
		<content:encoded><![CDATA[<p>how about use MMU+Dcache?<br />
as you know, when the MMU is disabled, the Dcache also couldn&#8217;t be used.  So if we use the MMU, and enable the Dcache, will the performance be better than no MMU and no Dcache?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B.G. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1046</link>
		<dc:creator>B.G. @ LI</dc:creator>
		<pubDate>Sun, 25 Jul 2010 17:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1046</guid>
		<description>i think a simple form of MPU, that simply detects invalid memory accesses is useful very, very often, for debugging and catching run-time errors

anything more depends upon the situation.
MPU that protects memory per process is only useful if you have indeed multiple processes, or an os/application boundary

MMU with address translation: flash image that does not fit in ram and not directly accessigle, HD as ram extension
more in general: if you want to treat storage not directly accessible to the CPU like it is, and/or cache things 

so for most single-process apps: a very simple MPU is sufficient

I doubt performance when using a MMU is an issue for high-end controllers, but the added complexity is (extra address translation step), so better avoid if it offers nothing.

For 16/8 bit systems with rather big memories (the normal case nowadays), even an basic MPU is less useful because almost any address is a valid one.

We used a basic MPU on a 16 bit system, no OS, one thread, with great benefits (reduced debug time), 

and we even used memory translation windows (=MMU) on small sytems to our benefit
- simpler address computations, big gain on many 8-bit systems
- more stable memory map, if HW descriptor size changes</description>
		<content:encoded><![CDATA[<p>i think a simple form of MPU, that simply detects invalid memory accesses is useful very, very often, for debugging and catching run-time errors</p>
<p>anything more depends upon the situation.<br />
MPU that protects memory per process is only useful if you have indeed multiple processes, or an os/application boundary</p>
<p>MMU with address translation: flash image that does not fit in ram and not directly accessigle, HD as ram extension<br />
more in general: if you want to treat storage not directly accessible to the CPU like it is, and/or cache things </p>
<p>so for most single-process apps: a very simple MPU is sufficient</p>
<p>I doubt performance when using a MMU is an issue for high-end controllers, but the added complexity is (extra address translation step), so better avoid if it offers nothing.</p>
<p>For 16/8 bit systems with rather big memories (the normal case nowadays), even an basic MPU is less useful because almost any address is a valid one.</p>
<p>We used a basic MPU on a 16 bit system, no OS, one thread, with great benefits (reduced debug time), </p>
<p>and we even used memory translation windows (=MMU) on small sytems to our benefit<br />
- simpler address computations, big gain on many 8-bit systems<br />
- more stable memory map, if HW descriptor size changes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: L.H. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1040</link>
		<dc:creator>L.H. @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1040</guid>
		<description>An MMU is not just a performance hit, it can be an especially non-deterministic one, for example, when page-based address translation is involved. That common type of translation minimizes its performance penalty by caching translations between virtual and physical addresses. However, when the translation misses in its cache, or context switching causes many things to be reloaded, each &quot;page table walk&quot; adds various additional memory accesses.

All that said, MMUs are a tremendous boon to reliability by making it easier to catch programming errors that would otherwise go undetected before causing much more costly problems. MMUs also make it easier to design the software architecture in a way that increases reliability, lowers costs, and yes, sometimes even increases performance: Not every performance problem can be placed at the feet of hardware speed. I&#039;d venture to say that unless you&#039;re running up against hard physical limits, plenty of us can make having an MMU a non-issue from a performance perspective.

There&#039;s probably enough knowledge in this group even to take a given problem and figure out how to make MMUs a non-issue from a real-time (determinism) perspective, given sufficient flexibility in the system architecture. It is done all the time; simply look around yourself right now and you&#039;ll see examples.

Though I think his cutoff of a million LOC is way too high, Alex has a good point about where an MMU doesn&#039;t make sense: Where the software is &quot;simple enough&quot;. 

An 8- or 16-bit processor with scarcely a 64K address space is much more often going to be &quot;simple enough&quot; compared with a processor having code that resides in megabytes or more of storage.

Where the amount of code is too large for any meaningful consensus that it is &quot;simple&quot;, but an MMU is an intractable show-stopper regardless, those would be the interesting examples to hear about from the &quot;no-MMU&quot; crowd.</description>
		<content:encoded><![CDATA[<p>An MMU is not just a performance hit, it can be an especially non-deterministic one, for example, when page-based address translation is involved. That common type of translation minimizes its performance penalty by caching translations between virtual and physical addresses. However, when the translation misses in its cache, or context switching causes many things to be reloaded, each &#8220;page table walk&#8221; adds various additional memory accesses.</p>
<p>All that said, MMUs are a tremendous boon to reliability by making it easier to catch programming errors that would otherwise go undetected before causing much more costly problems. MMUs also make it easier to design the software architecture in a way that increases reliability, lowers costs, and yes, sometimes even increases performance: Not every performance problem can be placed at the feet of hardware speed. I&#8217;d venture to say that unless you&#8217;re running up against hard physical limits, plenty of us can make having an MMU a non-issue from a performance perspective.</p>
<p>There&#8217;s probably enough knowledge in this group even to take a given problem and figure out how to make MMUs a non-issue from a real-time (determinism) perspective, given sufficient flexibility in the system architecture. It is done all the time; simply look around yourself right now and you&#8217;ll see examples.</p>
<p>Though I think his cutoff of a million LOC is way too high, Alex has a good point about where an MMU doesn&#8217;t make sense: Where the software is &#8220;simple enough&#8221;. </p>
<p>An 8- or 16-bit processor with scarcely a 64K address space is much more often going to be &#8220;simple enough&#8221; compared with a processor having code that resides in megabytes or more of storage.</p>
<p>Where the amount of code is too large for any meaningful consensus that it is &#8220;simple&#8221;, but an MMU is an intractable show-stopper regardless, those would be the interesting examples to hear about from the &#8220;no-MMU&#8221; crowd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K.P. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1039</link>
		<dc:creator>K.P. @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1039</guid>
		<description>There are certain CPU&#039;s that have a built-in MPU (Analog Devices&#039; Blackfin, ARM Cortex-M3, etc.), but they do not have an MMU. The MPU gives your application memory protection, while an MMU gives you full virtual memory (with MPU implied). An MMU will slow down a system (due to frequent accesses to the page table), but an MPU is very time efficient-- usually just loading some special registers when there is a thread change.

If you have a system that is mission critical, the use of an MPU is wise, and having an RTOS that provides API&#039;s to control it makes life easier. This way, each thread can have some guaranteed sections of memory. If the RTOS also guarantees a certain amount of CPU time, then you have a much safer system.</description>
		<content:encoded><![CDATA[<p>There are certain CPU&#8217;s that have a built-in MPU (Analog Devices&#8217; Blackfin, ARM Cortex-M3, etc.), but they do not have an MMU. The MPU gives your application memory protection, while an MMU gives you full virtual memory (with MPU implied). An MMU will slow down a system (due to frequent accesses to the page table), but an MPU is very time efficient&#8211; usually just loading some special registers when there is a thread change.</p>
<p>If you have a system that is mission critical, the use of an MPU is wise, and having an RTOS that provides API&#8217;s to control it makes life easier. This way, each thread can have some guaranteed sections of memory. If the RTOS also guarantees a certain amount of CPU time, then you have a much safer system.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.C. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1038</link>
		<dc:creator>J.C. @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1038</guid>
		<description>Please note that an MMU is a Memory Management Unit (see ARM 9, for example). ONE of its features is that it can prevent incorrect memory accesses, i.e. memory protection. By contrast, an MPU is specifically a Memory Protection Unit, and is a much less complex device than an MMU (see Atmel AVR32).</description>
		<content:encoded><![CDATA[<p>Please note that an MMU is a Memory Management Unit (see ARM 9, for example). ONE of its features is that it can prevent incorrect memory accesses, i.e. memory protection. By contrast, an MPU is specifically a Memory Protection Unit, and is a much less complex device than an MMU (see Atmel AVR32).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R.S. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1037</link>
		<dc:creator>R.S. @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1037</guid>
		<description>An MMU provides both protection, and management in the form of a logical to physical mapping layer, both of which I&#039;d suggest have their uses even without multiple processes.

Protection is useful in the development/debug phase of all sizes of products. If nothing else for NULL dereference detection and quicker detection of errant pointers while you&#039;re &quot;close&quot; to the origin of the error, rather than many cycles down the road. It&#039;s less useful if the hardware provides exception faults for accessing memory that doesn&#039;t exist on the bus and you can somehow get an exception for access in the first 1K.

Management can be useful in embedded projects even without linux or the like. At a previous incarnation we enhanced a standard RTOS with MMU support to support demand paging of a much larger image from flash storage into a physical 256KB of memory without resorting to manual overlays. It was also useful in getting different code sets into &#039;fast&#039; memory for different modes of operation without resorting to overlay trickery.</description>
		<content:encoded><![CDATA[<p>An MMU provides both protection, and management in the form of a logical to physical mapping layer, both of which I&#8217;d suggest have their uses even without multiple processes.</p>
<p>Protection is useful in the development/debug phase of all sizes of products. If nothing else for NULL dereference detection and quicker detection of errant pointers while you&#8217;re &#8220;close&#8221; to the origin of the error, rather than many cycles down the road. It&#8217;s less useful if the hardware provides exception faults for accessing memory that doesn&#8217;t exist on the bus and you can somehow get an exception for access in the first 1K.</p>
<p>Management can be useful in embedded projects even without linux or the like. At a previous incarnation we enhanced a standard RTOS with MMU support to support demand paging of a much larger image from flash storage into a physical 256KB of memory without resorting to manual overlays. It was also useful in getting different code sets into &#8216;fast&#8217; memory for different modes of operation without resorting to overlay trickery.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AIF @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1036</link>
		<dc:creator>AIF @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1036</guid>
		<description>MMU slows down access to the physical memory and local bus, at least on the &quot;large&quot; processors like PowerPC or Intel. 
If you run uC/OS with multiple threads (not processes) there is no advantage of setting up MMU except that it slows down local bus access 2 to 10 times depends how you do it. 
The bottom line if your system is complex and built upon multiple processes written by multiple teams you better off with MMU. If you are building small (a few million lines of code) high performance system MMU will hinder your performance.</description>
		<content:encoded><![CDATA[<p>MMU slows down access to the physical memory and local bus, at least on the &#8220;large&#8221; processors like PowerPC or Intel.<br />
If you run uC/OS with multiple threads (not processes) there is no advantage of setting up MMU except that it slows down local bus access 2 to 10 times depends how you do it.<br />
The bottom line if your system is complex and built upon multiple processes written by multiple teams you better off with MMU. If you are building small (a few million lines of code) high performance system MMU will hinder your performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A.S. @ LI</title>
		<link>http://www.embeddedinsights.com/channels/2010/07/21/to-mmu-or-not-to-mmu/#comment-1035</link>
		<dc:creator>A.S. @ LI</dc:creator>
		<pubDate>Sat, 24 Jul 2010 22:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.embeddedinsights.com/channels/?p=215#comment-1035</guid>
		<description>MMU or not MMU means &quot;memory protection&quot; or &quot;Not memory protection&quot;.

Memory protection is needed for security/stability if you have multiple processes running in your system. An MMU is useless for deeply embedded systems running only a single multi threaded process. That&#039;s the whole religion behind it :)</description>
		<content:encoded><![CDATA[<p>MMU or not MMU means &#8220;memory protection&#8221; or &#8220;Not memory protection&#8221;.</p>
<p>Memory protection is needed for security/stability if you have multiple processes running in your system. An MMU is useless for deeply embedded systems running only a single multi threaded process. That&#8217;s the whole religion behind it <img src='http://www.embeddedinsights.com/channels/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
