亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 內(nèi)核碎片引起oom [打印本頁]

作者: linuxfellow    時間: 2015-03-17 09:17
標(biāo)題: 內(nèi)核碎片引起oom
本帖最后由 linuxfellow 于 2015-03-17 09:21 編輯

系統(tǒng)碎片太多,導(dǎo)致oom觸發(fā)。oom啟動時,系統(tǒng)還有17兆Bytes空閑空間,但都是order 0, 1, 2的頁面,大頁全部消耗殆盡。
說明內(nèi)核有外部碎片問題。能想到的辦法就是
1:  CONFIG_COMPACT=y   
2:    減小應(yīng)用程序申請內(nèi)存時的粒度
       uclibc里DEFAULT_TRIM_THRESHOLD缺省時256k. 可能太大,改為64k如何?

下面是防止一般oom的方法:
3: 設(shè)置DEF_PRIORITY 比較小的數(shù)值, scan一次掃描更多的頁面,對系統(tǒng)性能影響大嗎 ?
    569 /*
    570  * The "priority" of VM scanning is how much of the queues we will scan in one
    571  * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
    572  * queues ("queue_length >> 12") during an aging round.
    573  */
    574 #define DEF_PRIORITY 12
4:修改zone_watermark_ok算法,拉大watermark_low/watermark_min的差距,盡早啟動kswapd使其有足夠的時間回收頁面

不知從uclibc/glibc層面上考慮,還有什么好辦法沒有?

作者: linuxfellow    時間: 2015-03-17 10:11
是呀,最近有空研究一下oom,發(fā)出來共享
作者: gaojl0728    時間: 2015-03-17 12:13
打開CONFIG_COMPACT 已經(jīng)可以了。
作者: linuxfellow    時間: 2015-03-18 08:45
回復(fù) 3# gaojl0728
增加了該選項,在做24小時測試,明天看結(jié)果

   
作者: linuxfellow    時間: 2015-03-18 08:50
第二項也想試試,但是沒有找到uclibc 里對應(yīng)的配置選項,要修改malloc.h,暫時放下
作者: linuxfellow    時間: 2015-03-20 09:52
本帖最后由 linuxfellow 于 2015-03-20 09:54 編輯

典型的內(nèi)存碎片問題實例, 大頁都用光了,只剩小頁:
Normal: 4229*4kB 34*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 17188kB

還有運行一個狠小的shell程序,至少也要4頁內(nèi)存,app_abc.sh: page allocation failure: order:2, mode:0xd0

Out of memory (oom_kill_allocating_task): Kill process 3470 (app_abc.sh) score 0 or sacrifice child
Killed process 3470 (app_abc.sh) total-vm:1160kB, anon-rss:60kB, file-rss:96kB
app_abc.sh: page allocation failure: order:2, mode:0xd0
[<c001346c>] (unwind_backtrace+0x0/0xec) from [<c005da50>] (warn_alloc_failed+0xc8/0x11c)
[<c005da50>] (warn_alloc_failed+0xc8/0x11c) from [<c005f9f8>] (__alloc_pages_nodemask+0x108/0x61
[<c005f9f8>] (__alloc_pages_nodemask+0x108/0x61 from [<c005ff18>] (__get_free_pages+0x10/0x4c)
[<c005ff18>] (__get_free_pages+0x10/0x4c) from [<c00158b8>] (pgd_alloc+0x14/0xe0)
[<c00158b8>] (pgd_alloc+0x14/0xe0) from [<c001e25c>] (mm_init.isra.56+0x94/0xd
[<c001e25c>] (mm_init.isra.56+0x94/0xd from [<c008f3a4>] (bprm_mm_init+0x10/0x18
[<c008f3a4>] (bprm_mm_init+0x10/0x18 from [<c008f858>] (do_execve+0xf0/0x2a0)
[<c008f858>] (do_execve+0xf0/0x2a0) from [<c0011064>] (sys_execve+0x34/0x54)
[<c0011064>] (sys_execve+0x34/0x54) from [<c000de00>] (ret_fast_syscall+0x0/0x30)
Mem-info:
Normal per-cpu:
CPU    0: hi:   42, btch:   7 usd:  10
active_anon:14135 inactive_anon:4244 isolated_anon:0
active_file:58 inactive_file:76 isolated_file:0
unevictable:4254 dirty:5 writeback:1 unstable:0
free:4325 slab_reclaimable:468 slab_unreclaimable:2239
mapped:571 shmem:5183 pagetables:302 bounce:0
Normal free:17188kB min:1440kB low:1800kB high:2160kB active_anon:56540kB inactive_anon:16976kB active_file:252kB inactive_file:524kB unevictable:17016kB isolated(anon):0kB isolated(file):68kB present:130048kB mlocked:0kB dirty:20kB writeback:4kB mapped:2356kB shmem:20732kB slab_reclaimable:1872kB slab_unreclaimable:8956kB kernel_stack:1768kB pagetables:1208kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:17 all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 4229*4kB 34*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 17188kB
9637 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
32768 pages of RAM
4765 free pages
1553 reserved pages
2707 slab pages
5949 pages shared
0 pages swap cached





歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2