<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: imx53 video DMA memory fragmentation</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/415801#M62452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt; Below are considerations regarding the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt; Usually SoC peripherals, allocate memory using dma_alloc_coherent() ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;this kernel function return contiguous memory area.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;To preserve contiguous memory region :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ echo 1 &amp;gt; /proc/sys/vm/lowmem_reserve_ratio&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;Setting the parameter in this way, the Kernel will prevent application and file &lt;BR /&gt; caching to fragment “too much” memory. However it will limit the amount of &lt;BR /&gt; memory that applications can allocate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;For Dropping Caches :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;This will free all system caches, but this can impact other applications running&lt;BR /&gt; in the system, requiring them to load the files they use each time the caches &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;are dropped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;There are tools for avoiding file caching of a specific application like the &lt;BR /&gt; pagecache-management &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&lt;A class="jive-link-external-small" href="https://code.google.com/p/pagecache-mangagement" rel="nofollow"&gt;https://code.google.com/p/pagecache-mangagement&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;This is an open source project not maintained and not supported by Freescale, &lt;BR /&gt;which could anyway help in the intent.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2015 03:48:19 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2015-11-20T03:48:19Z</dc:date>
    <item>
      <title>imx53 video DMA memory fragmentation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/415800#M62451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We use the analogue video input to display video on our screen on the imx53 standard platform which has a problem with displaying the video feed for an extended amount of time.&amp;nbsp; On average we're finding that after about 3 weeks of displaying the video feed on the screen we get DMA memory fragmentation.&amp;nbsp; The DMA memory fragmentation fragments so much that the video cannot start as it cannot allocate a contiguous memory block big enough and the video cannot be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Linux kernel is 2.6.35.3 11_09 and we use the command to run the video&lt;/P&gt;&lt;P&gt;/unit_tests/mxc_v4l2_tvin.out -ow 450 -oh 600 -ol 550 -ot 1 -r 6 -f YU12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found the cat /proc/buddyinfo indicates that over time the free slots are 0's down to the size required to start the video&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found that the memory compaction isn't available with this kernel release which is meant to re-order slots to fix the memory fragmentation issue that we're seeing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is,&lt;/P&gt;&lt;P&gt;Has anyone found issues with displaying video for extended amounts of time on the imx53 linux 2.6.35.3 11_09 image.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone found the need to get the compact the memory fragmentation which doesn't seem available as it doesn't compile in the 2.6.35 kernel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 02:03:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/415800#M62451</guid>
      <dc:creator>TimWoodham</dc:creator>
      <dc:date>2015-11-17T02:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: imx53 video DMA memory fragmentation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/415801#M62452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt; Below are considerations regarding the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt; Usually SoC peripherals, allocate memory using dma_alloc_coherent() ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;this kernel function return contiguous memory area.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;To preserve contiguous memory region :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ echo 1 &amp;gt; /proc/sys/vm/lowmem_reserve_ratio&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;Setting the parameter in this way, the Kernel will prevent application and file &lt;BR /&gt; caching to fragment “too much” memory. However it will limit the amount of &lt;BR /&gt; memory that applications can allocate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;For Dropping Caches :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;This will free all system caches, but this can impact other applications running&lt;BR /&gt; in the system, requiring them to load the files they use each time the caches &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;are dropped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;There are tools for avoiding file caching of a specific application like the &lt;BR /&gt; pagecache-management &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&lt;A class="jive-link-external-small" href="https://code.google.com/p/pagecache-mangagement" rel="nofollow"&gt;https://code.google.com/p/pagecache-mangagement&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;This is an open source project not maintained and not supported by Freescale, &lt;BR /&gt;which could anyway help in the intent.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 03:48:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/415801#M62452</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-11-20T03:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: imx53 video DMA memory fragmentation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/2184470#M241326</link>
      <description>&lt;P&gt;We've started getting this too.&lt;/P&gt;&lt;P&gt;In our case this is triggered by the video input being closed and opened at regular intervals (to display the image at a different scale). Every time this happens (on the "open()") the driver allocated a very large "dummy buffer" and four "screen buffers", all from contiguous DMA memory.&lt;/P&gt;&lt;P&gt;This is made worse by the TX53 continuously logging to a USB stick. These operations cache all the file data, and that's the main cause of the fragmentation. The suggestion of "drop_caches" fixes this problem, but causes stalls and other problems.&lt;/P&gt;&lt;P&gt;It fails trying to get the dummy buffer. There's a problem with the drivers in that they don't recover from this. Even if memory is freed up, the drivers won't work again until the unit is power cycled. That's a different bug.&lt;/P&gt;&lt;P&gt;There's a patch dated 2011 as "ENGR00159773-1" which caches the dummy buffer. There's a later patch "ENGR00169880" that allocates this buffer on the "probe()" rather than on the first "open()".&lt;/P&gt;&lt;P&gt;Applying these patches (if you have a later release, you should have these already) makes it last a little longer, but then it fails allocating the second of the four "Frame Buffers". There are no patches to cache these (but there should be).&lt;/P&gt;&lt;P&gt;The suggestion to "&lt;SPAN&gt;echo 1 &amp;gt; /proc/sys/vm/lowmem_reserve_ratio&lt;/SPAN&gt;" does fix the problem in our case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 03:08:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx53-video-DMA-memory-fragmentation/m-p/2184470#M241326</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2025-10-13T03:08:00Z</dc:date>
    </item>
  </channel>
</rss>

