<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>memory &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/memory/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Fri, 30 Sep 2011 17:09:04 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>OOM &#8211; Out of Memory.</title>
		<link>https://richliu.com/2011/10/01/1128/oom-out-of-memory/</link>
					<comments>https://richliu.com/2011/10/01/1128/oom-out-of-memory/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 30 Sep 2011 17:08:18 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[OOM]]></category>
		<category><![CDATA[out of memory]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=1128</guid>

					<description><![CDATA[<p>OOM &#8211; Out of Memory. 筆記文章 目前最好的文章. When Linux Run [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2011/10/01/1128/oom-out-of-memory/">OOM &#8211; Out of Memory.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>OOM &#8211; Out of Memory.<br />
筆記文章<br />
<span id="more-1128"></span></p>
<p>目前最好的文章.<br />
<a href="http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html" target="_blank" rel="noopener">When Linux Runs Out of Memory</a><br />
另一份不錯的文章<br />
<a href="http://lwn.net/Articles/317814/" target="_blank" rel="noopener">Taming the OOM killer</a><br />
這篇文章有講到可以設權值. userspace 去處理 OOM 問題等等.</p>
<p>原因<br />
或許是 fragment memory 造成的, 也有可能 kernel 佔去太多 memory. </p>
<p>解決方案<br />
完全啟用 Linux kernel over commit 機制.<br />
echo 1 > /proc/sys/vm/overcommit_memory</p>
<p>其他參考文件<br />
<a href="http://www.ibm.com/developerworks/linux/library/l-linux-slab-allocator/" target="_blank" rel="noopener">Dynamic memory management </a><br />
Another approach, called buddy memory allocation, is a faster memory technique that divides memory into power-of-2 partitions and attempts to allocate memory requests using a best-fit approach. When memory is freed by the user, the buddy block is checked to see if any of its contiguous neighbors have also been freed. If so, the blocks are combined to minimize fragmentation. This algorithm tends to be a bit more time efficient but can waste memory due to the best-fit approach.<br />
* 註: Linux 己經使用這個機制. </p>
<p>分析檔案</p>
<p>其他<br />
<a href="http://puschitz.com/pblog/?p=28" target="_blank" rel="noopener">Memory Fragmentation</a><br />
<a href="http://www.win.tue.nl/~aeb/linux/lk/lk-9.html" target="_blank" rel="noopener">Memory</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2011/10/01/1128/oom-out-of-memory/">OOM &#8211; Out of Memory.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2011/10/01/1128/oom-out-of-memory/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</title>
		<link>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/</link>
					<comments>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 13:05:31 +0000</pubDate>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Jumbo Frame]]></category>
		<category><![CDATA[linux kernel]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[samba]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=822</guid>

					<description><![CDATA[<p>如果啟動了 Jumbo Frame 加上執行 Samba , 有可能會出現類似的訊息(系統抓下來似乎有點不全) [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/">[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>如果啟動了 Jumbo Frame 加上執行 Samba , 有可能會出現類似的訊息(系統抓下來似乎有點不全)</p>
<p><span id="more-822"></span></p>
<blockquote><p>smbd: page allocation failure. order:2, mode:0x20<br />
Backtrace:<br />
[&lt;c002fd30&gt;] (dump_backtrace+0x0/0x108) from [&lt;c02ac488&gt;] (dump_stack+0x18/0x1c)<br />
[&lt;c02ac470&gt;] (dump_stack+0x0/0x1c) from [&lt;c0075734&gt;] (__alloc_pages_nodemask+0x3d0/0x55c)<br />
[&lt;c0075364&gt;] (__alloc_pages_nodemask+0x0/0x55c) from [&lt;c008f5d8&gt;] (cache_alloc_refill+0x2b0/0x598)<br />
[&lt;c008f328&gt;] (cache_alloc_refill+0x0/0x598) from [&lt;c008f978&gt;] (__kmalloc+0xb8/0xd8)<br />
[&lt;c008f8c0&gt;] (__kmalloc+0x0/0xd8) from [&lt;c0227a6c&gt;] (__alloc_skb+0x54/0x138)<br />
[&lt;c0227a18&gt;] (__alloc_skb+0x0/0x138) from [&lt;c022879c&gt;] (dev_alloc_skb+0x20/0x44)<br />
[&lt;c022877c&gt;] (dev_alloc_skb+0x0/0x44) from [&lt;c01e643c&gt;] (cns3xxx_receive_packet+0x228/0x3c8)<br />
[&lt;c01e6214&gt;] (cns3xxx_receive_packet+0x0/0x3c8) from [&lt;c01e661c&gt;] (cns3xxx_poll+0x40/0xd4)<br />
[&lt;c01e65dc&gt;] (cns3xxx_poll+0x0/0xd4) from [&lt;c022f264&gt;] (net_rx_action+0xb4/0x184)<br />
[&lt;c022f1b0&gt;] (net_rx_action+0x0/0x184) from [&lt;c0048544&gt;] (__do_softirq+0x90/0x11c)<br />
[&lt;c00484b4&gt;] (__do_softirq+0x0/0x11c) from [&lt;c0048614&gt;] (irq_exit+0x44/0x4c)<br />
[&lt;c00485d0&gt;] (irq_exit+0x0/0x4c) from [&lt;c002b04c&gt;] (_text+0x4c/0x90)<br />
[&lt;c002b000&gt;] (_text+0x0/0x90) from [&lt;c002bab8&gt;] (__irq_svc+0x38/0x80)<br />
Exception stack(0xc7acbcc0 to 0xc7acbd08)<br />
bcc0: c7acbd1c c7829960 c7acbd28 00000000 00000001 c7b53980 c7b539e4 c7acbd1c<br />
bce0: 00000000 00000000 c7acbf08 c7acbd14 c7acbd28 c7acbd08 c0222314 c0057a0c<br />
bd00: 60000013 ffffffff<br />
[&lt;c00579b0&gt;] (finish_wait+0x0/0x6c) from [&lt;c0222314&gt;] (sk_wait_data+0xcc/0xec)<br />
[&lt;c0222248&gt;] (sk_wait_data+0x0/0xec) from [&lt;c0255fc0&gt;] (tcp_recvmsg+0x600/0x8a8)<br />
[&lt;c02559c0&gt;] (tcp_recvmsg+0x0/0x8a8) from [&lt;c0221208&gt;] (sock_common_recvmsg+0x48/0x5c)<br />
[&lt;c02211c0&gt;] (sock_common_recvmsg+0x0/0x5c) from [&lt;c021e7d8&gt;] (sock_aio_read+0x138/0x144)<br />
[&lt;c021e6a0&gt;] (sock_aio_read+0x0/0x144) from [&lt;c0092918&gt;] (do_sync_read+0xc4/0x110)<br />
[&lt;c0092854&gt;] (do_sync_read+0x0/0x110) from [&lt;c00936ac&gt;] (vfs_read+0x164/0x16c)<br />
[&lt;c0093548&gt;] (vfs_read+0x0/0x16c) from [&lt;c0093790&gt;] (sys_read+0x44/0x74)<br />
[&lt;c009374c&gt;] (sys_read+0x0/0x74) from [&lt;c002be40&gt;] (ret_fast_syscall+0x0/0x2c)<br />
Mem-info:<br />
Normal per-cpu:<br />
CPU    0: hi:   42, btch:   7 usd:  32<br />
Active_anon:570 active_file:9598 inactive_anon:576<br />
inactive_file:17657 unevictable:0 dirty:3503 writeback:0 unstable:0<br />
free:419 slab:2389 mapped:1587 pagetables:87 bounce:0<br />
Normal free:1676kB min:1440kB low:1800kB high:2160kB active_anon:2280kB inactive_anon:2304kB active_file:38392kB inactive_file:70628kB unevictable:0kB present:130048kB pages_scanned:0 all_unreclaimable? no<br />
lowmem_reserve[]: 0 0<br />
Normal: 345*4kB 25*8kB 6*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1676kB<br />
27277 total pagecache pages<br />
32768 pages of RAM<br />
543 free pages<br />
1251 reserved pages<br />
2389 slab pages<br />
29382 pages shared<br />
0 pages swap cached</p></blockquote>
<p>可以加大 kernel 預留的 Buffer, 我系統上原來是 1117, 可以用指令</p>
<p><strong>echo 8192 &gt; /proc/sys/vm/min_free_kbytes</strong><strong><br />
</strong></p>
<p>加大到 8Mbytes, 這樣可以減少 page allocation 失敗的機率, 在我們的測試內, 某些時候 8MByte 仍會出現, 可以考慮加大到 16Mbytes.</p>
<p>原因是因為在 interrupt 中, 向系統一次要求大塊的記憶體. 這時可以透過增加 min_free_kbytes 參數去避過這個問題.<br />
調整 slab 的參數或許也有用  ( echo x y z &gt; /proc/slab)</p>
<p>Ref.<br />
http://lime-technology.com/forum/index.php?topic=3999.0<br />
http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-01/0059.html</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/">[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
