简体   繁体   English

Linux Kernel memory未满时模块OOM

[英]Linux Kernel module OOM when memory is not full

I write my own kernel module and I get this error: Kernel panic - not syncing: Out of memory and no killable processes... But when I looking to htop I see the system use only 700 M from 3G.我写了我自己的 kernel 模块,我得到这个错误:Kernel panic - not syncing: Out of memory and no killable processes... 但是当我查看 htop 时,我看到系统只使用 3G 的 700 M。 So they still have a memory.所以他们还有一个memory。

I use customize linux kernel 2.6.32.61 and in this module I must often alloc 188 B. I use kmem_cache_alloc() , for alloc this memory. This error is strange, because is occurs randomly.我使用自定义 linux kernel 2.6.32.61 并且在这个模块中我必须经常分配 188 B。我使用kmem_cache_alloc()来分配这个 memory。这个错误很奇怪,因为它是随机发生的。 Sometimes I got this error immediately, when I init the module and sometimes the module run some minutes.有时我会立即收到此错误,当我初始化模块时,有时模块会运行几分钟。 And sometimes I got this error: (see below).有时我会收到此错误:(见下文)。

Can you help me with this error?你能帮我解决这个错误吗? Or can you give me more information about the error message(see below)?或者你能给我更多关于错误信息的信息吗(见下文)?

On this error message I see function which I use, but when I look at it, it's look normal, so I don't know why I got this error.在此错误消息中,我看到了我使用的 function,但当我查看它时,它看起来很正常,所以我不知道为什么会出现此错误。

Thanks for the help.谢谢您的帮助。

PS: Sorry for my bad English PS:抱歉我的英语不好

sequencer_threa invoked oom-killer: gfp_mask=0xd0, order=0, oom_adj=0
Sep 25 14:20:51 optisat kernel: [  159.043727] sequencer_threa cpuset=/ mems_allowed=0
Sep 25 14:20:51 optisat kernel: [  159.043730] Pid: 2792, comm: sequencer_threa Not tainted 2.6.32.61 #18
Sep 25 14:20:51 optisat kernel: [  159.043731] Call Trace:
Sep 25 14:20:51 optisat kernel: [  159.043736]  [<c10919ce>] oom_kill_process+0x9e/0x2c0
Sep 25 14:20:51 optisat kernel: [  159.043738]  [<c1091fcd>] ? select_bad_process+0xad/0xf0
Sep 25 14:20:51 optisat kernel: [  159.043740]  [<c1092053>] __out_of_memory+0x43/0xb0
Sep 25 14:20:51 optisat kernel: [  159.043742]  [<c1092332>] out_of_memory+0x52/0xb0
Sep 25 14:20:51 optisat kernel: [  159.043744]  [<c109517c>] __alloc_pages_nodemask+0x55c/0x570
Sep 25 14:20:51 optisat kernel: [  159.043747]  [<c12c2387>] cache_alloc_refill+0x2ea/0x5f6
Sep 25 14:20:51 optisat kernel: [  159.043750]  [<c10b5ad6>] kmem_cache_alloc+0x136/0x150
Sep 25 14:20:51 optisat kernel: [  159.043753]  [<f9d94542>] ? alloc_ts_pkt+0x12/0x30 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043756]  [<f9d94542>] alloc_ts_pkt+0x12/0x30 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043758]  [<f9d9190c>] build_t2_mi_pkts+0x12c/0x360 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043760]  [<c10b5a9d>] ? kmem_cache_alloc+0xfd/0x150
Sep 25 14:20:51 optisat kernel: [  159.043763]  [<f9d92f14>] parse_ref_packet+0x13d4/0x1e50 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043765]  [<c12c6e02>] ? _spin_unlock_irq+0x22/0x30
Sep 25 14:20:51 optisat kernel: [  159.043768]  [<c105cbcb>] ? trace_hardirqs_on+0xb/0x10
Sep 25 14:20:51 optisat kernel: [  159.043770]  [<c1050eed>] ? sched_clock_cpu+0xed/0x160
Sep 25 14:20:51 optisat kernel: [  159.043773]  [<c1023af0>] ? finish_task_switch+0x0/0xd0
Sep 25 14:20:51 optisat kernel: [  159.043776]  [<c11ca89b>] ? e1000e_set_d3_lplu_state+0x15b/0x170
Sep 25 14:20:51 optisat kernel: [  159.043778]  [<c12c6db1>] ? _spin_unlock_irqrestore+0x31/0x60
Sep 25 14:20:51 optisat kernel: [  159.043780]  [<c105cb54>] ? trace_hardirqs_on_caller+0x114/0x180
Sep 25 14:20:51 optisat kernel: [  159.043782]  [<c105cbcb>] ? trace_hardirqs_on+0xb/0x10
Sep 25 14:20:51 optisat kernel: [  159.043784]  [<f9d96ac9>] sequencer_thread+0x239/0x4a0 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043787]  [<c104b450>] ? autoremove_wake_function+0x0/0x40
Sep 25 14:20:51 optisat kernel: [  159.043790]  [<f9d96890>] ? sequencer_thread+0x0/0x4a0 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.043792]  [<c104aea5>] kthread+0x65/0x70
Sep 25 14:20:51 optisat kernel: [  159.043794]  [<c104ae40>] ? kthread+0x0/0x70
Sep 25 14:20:51 optisat kernel: [  159.043796]  [<c10038eb>] kernel_thread_helper+0x7/0x1c
Sep 25 14:20:51 optisat kernel: [  159.043797] Mem-Info:
Sep 25 14:20:51 optisat kernel: [  159.043798] DMA per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.043799] CPU    0: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043800] CPU    1: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043801] CPU    2: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043802] CPU    3: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043803] Normal per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.043804] CPU    0: hi:  186, btch:  31 usd: 144
Sep 25 14:20:51 optisat kernel: [  159.043805] CPU    1: hi:  186, btch:  31 usd: 197
Sep 25 14:20:51 optisat kernel: [  159.043806] CPU    2: hi:  186, btch:  31 usd: 143
Sep 25 14:20:51 optisat kernel: [  159.043807] CPU    3: hi:  186, btch:  31 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043808] HighMem per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.043809] CPU    0: hi:  186, btch:  31 usd: 172
Sep 25 14:20:51 optisat kernel: [  159.043810] CPU    1: hi:  186, btch:  31 usd: 170
Sep 25 14:20:51 optisat kernel: [  159.043811] CPU    2: hi:  186, btch:  31 usd: 169
Sep 25 14:20:51 optisat kernel: [  159.043812] CPU    3: hi:  186, btch:  31 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.043814] active_anon:4330 inactive_anon:1137 isolated_anon:0
Sep 25 14:20:51 optisat kernel: [  159.043815]  active_file:1373 inactive_file:2388 isolated_file:0
Sep 25 14:20:51 optisat kernel: [  159.043815]  unevictable:0 dirty:79 writeback:0 unstable:0
Sep 25 14:20:51 optisat kernel: [  159.043816]  free:607286 slab_reclaimable:2764 slab_unreclaimable:190380
Sep 25 14:20:51 optisat kernel: [  159.043816]  mapped:1813 shmem:59 pagetables:160 bounce:0
Sep 25 14:20:51 optisat kernel: [  159.043819] DMA free:3460kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15668kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:11592kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.043822] lowmem_reserve[]: 0 859 3236 3236
Sep 25 14:20:51 optisat kernel: [  159.043826] Normal free:2732kB min:3716kB low:4644kB high:5572kB active_anon:0kB inactive_anon:0kB active_file:4kB inactive_file:68kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:879840kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:0kB slab_reclaimable:11056kB slab_unreclaimable:749928kB kernel_stack:952kB pagetables:640kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:28 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.043829] lowmem_reserve[]: 0 0 19015 19015
Sep 25 14:20:51 optisat kernel: [  159.043833] HighMem free:2422952kB min:512kB low:3080kB high:5652kB active_anon:17320kB inactive_anon:4548kB active_file:5488kB inactive_file:9484kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:2433944kB mlocked:0kB dirty:316kB writeback:0kB mapped:7248kB shmem:236kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.043836] lowmem_reserve[]: 0 0 0 0
Sep 25 14:20:51 optisat kernel: [  159.043838] DMA: 2*4kB 2*8kB 1*16kB 2*32kB 2*64kB 3*128kB 1*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3432kB
Sep 25 14:20:51 optisat kernel: [  159.043844] Normal: 16*4kB 1*8kB 0*16kB 0*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 2824kB
Sep 25 14:20:51 optisat kernel: [  159.043850] HighMem: 1485*4kB 808*8kB 471*16kB 204*32kB 99*64kB 36*128kB 5*256kB 1*512kB 2*1024kB 3*2048kB 580*4096kB = 2423076kB
Sep 25 14:20:51 optisat kernel: [  159.043855] 3815 total pagecache pages
Sep 25 14:20:51 optisat kernel: [  159.043856] 0 pages in swap cache
Sep 25 14:20:51 optisat kernel: [  159.043857] Swap cache stats: add 0, delete 0, find 0/0
Sep 25 14:20:51 optisat kernel: [  159.043858] Free swap  = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.043859] Total swap = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.048960] 849904 pages RAM
Sep 25 14:20:51 optisat kernel: [  159.048961] 622594 pages HighMem
Sep 25 14:20:51 optisat kernel: [  159.048962] 35058 pages reserved
Sep 25 14:20:51 optisat kernel: [  159.048963] 8458 pages shared
Sep 25 14:20:51 optisat kernel: [  159.048964] 202716 pages non-shared
Sep 25 14:20:51 optisat kernel: [  159.048965] Out of memory: kill process 2797 (make) score 2343 or a child
Sep 25 14:20:51 optisat kernel: [  159.049026] Killed process 2998 (beam.smp)
Sep 25 14:20:51 optisat kernel: [  159.094076] sequencer_threa invoked oom-killer: gfp_mask=0xd0, order=0, oom_adj=0
Sep 25 14:20:51 optisat kernel: [  159.094080] sequencer_threa cpuset=/ mems_allowed=0
Sep 25 14:20:51 optisat kernel: [  159.094082] Pid: 2792, comm: sequencer_threa Not tainted 2.6.32.61 #18
Sep 25 14:20:51 optisat kernel: [  159.094084] Call Trace:
Sep 25 14:20:51 optisat kernel: [  159.094088]  [<c10919ce>] oom_kill_process+0x9e/0x2c0
Sep 25 14:20:51 optisat kernel: [  159.094090]  [<c1091fcd>] ? select_bad_process+0xad/0xf0
Sep 25 14:20:51 optisat kernel: [  159.094092]  [<c1092053>] __out_of_memory+0x43/0xb0
Sep 25 14:20:51 optisat kernel: [  159.094094]  [<c1092332>] out_of_memory+0x52/0xb0
Sep 25 14:20:51 optisat kernel: [  159.094097]  [<c109517c>] __alloc_pages_nodemask+0x55c/0x570
Sep 25 14:20:51 optisat kernel: [  159.094100]  [<c12c2387>] cache_alloc_refill+0x2ea/0x5f6
Sep 25 14:20:51 optisat kernel: [  159.094103]  [<c10b5ad6>] kmem_cache_alloc+0x136/0x150
Sep 25 14:20:51 optisat kernel: [  159.094107]  [<f9d94542>] ? alloc_ts_pkt+0x12/0x30 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.094109]  [<f9d94542>] alloc_ts_pkt+0x12/0x30 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.094111]  [<f9d92b04>] parse_ref_packet+0xfc4/0x1e50 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.094114]  [<c105a89b>] ? trace_hardirqs_off+0xb/0x10
Sep 25 14:20:51 optisat kernel: [  159.094116]  [<c1050f05>] ? sched_clock_cpu+0x105/0x160
Sep 25 14:20:51 optisat kernel: [  159.094119]  [<c1050eed>] ? sched_clock_cpu+0xed/0x160
Sep 25 14:20:51 optisat kernel: [  159.094121]  [<c10b45e3>] ? cache_free_debugcheck+0xe3/0x300
Sep 25 14:20:51 optisat kernel: [  159.094124]  [<c113d465>] ? __debug_check_no_obj_freed+0x125/0x190
Sep 25 14:20:51 optisat kernel: [  159.094125]  [<c105a89b>] ? trace_hardirqs_off+0xb/0x10
Sep 25 14:20:51 optisat kernel: [  159.094128]  [<c105cbcb>] ? trace_hardirqs_on+0xb/0x10
Sep 25 14:20:51 optisat kernel: [  159.094130]  [<f9d969da>] sequencer_thread+0x14a/0x4a0 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.094134]  [<c104b450>] ? autoremove_wake_function+0x0/0x40
Sep 25 14:20:51 optisat kernel: [  159.094136]  [<f9d96890>] ? sequencer_thread+0x0/0x4a0 [optimux_rx]
Sep 25 14:20:51 optisat kernel: [  159.094139]  [<c104aea5>] kthread+0x65/0x70
Sep 25 14:20:51 optisat kernel: [  159.094141]  [<c104ae40>] ? kthread+0x0/0x70
Sep 25 14:20:51 optisat kernel: [  159.094143]  [<c10038eb>] kernel_thread_helper+0x7/0x1c
Sep 25 14:20:51 optisat kernel: [  159.094144] Mem-Info:
Sep 25 14:20:51 optisat kernel: [  159.094145] DMA per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.094146] CPU    0: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.094147] CPU    1: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.094148] CPU    2: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.094149] CPU    3: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.094150] Normal per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.094152] CPU    0: hi:  186, btch:  31 usd: 165
Sep 25 14:20:51 optisat kernel: [  159.094153] CPU    1: hi:  186, btch:  31 usd: 204
Sep 25 14:20:51 optisat kernel: [  159.094154] CPU    2: hi:  186, btch:  31 usd: 143
Sep 25 14:20:51 optisat kernel: [  159.094155] CPU    3: hi:  186, btch:  31 usd:  33
Sep 25 14:20:51 optisat kernel: [  159.094156] HighMem per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.094156] CPU    0: hi:  186, btch:  31 usd: 172
Sep 25 14:20:51 optisat kernel: [  159.094157] CPU    1: hi:  186, btch:  31 usd: 170
Sep 25 14:20:51 optisat kernel: [  159.094158] CPU    2: hi:  186, btch:  31 usd: 169
Sep 25 14:20:51 optisat kernel: [  159.094160] CPU    3: hi:  186, btch:  31 usd: 116
Sep 25 14:20:51 optisat kernel: [  159.094162] active_anon:4329 inactive_anon:1041 isolated_anon:0
Sep 25 14:20:51 optisat kernel: [  159.094163]  active_file:1394 inactive_file:2381 isolated_file:0
Sep 25 14:20:51 optisat kernel: [  159.094163]  unevictable:0 dirty:92 writeback:0 unstable:0
Sep 25 14:20:51 optisat kernel: [  159.094164]  free:607290 slab_reclaimable:2518 slab_unreclaimable:190594
Sep 25 14:20:51 optisat kernel: [  159.094165]  mapped:1744 shmem:59 pagetables:155 bounce:0
Sep 25 14:20:51 optisat kernel: [  159.094168] DMA free:3460kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15668kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:11592kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.094171] lowmem_reserve[]: 0 859 3236 3236
Sep 25 14:20:51 optisat kernel: [  159.094175] Normal free:2872kB min:3716kB low:4644kB high:5572kB active_anon:0kB inactive_anon:0kB active_file:4kB inactive_file:68kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:879840kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:0kB slab_reclaimable:10072kB slab_unreclaimable:750784kB kernel_stack:952kB pagetables:620kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.094179] lowmem_reserve[]: 0 0 19015 19015
Sep 25 14:20:51 optisat kernel: [  159.094183] HighMem free:2422828kB min:512kB low:3080kB high:5652kB active_anon:17316kB inactive_anon:4164kB active_file:5572kB inactive_file:9456kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:2433944kB mlocked:0kB dirty:368kB writeback:0kB mapped:6972kB shmem:236kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.094186] lowmem_reserve[]: 0 0 0 0
Sep 25 14:20:51 optisat kernel: [  159.094188] DMA: 2*4kB 2*8kB 1*16kB 2*32kB 2*64kB 3*128kB 1*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3432kB
Sep 25 14:20:51 optisat kernel: [  159.094194] Normal: 28*4kB 1*8kB 0*16kB 0*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 2872kB
Sep 25 14:20:51 optisat kernel: [  159.094200] HighMem: 1454*4kB 808*8kB 471*16kB 204*32kB 99*64kB 36*128kB 5*256kB 1*512kB 2*1024kB 3*2048kB 580*4096kB = 2422952kB
Sep 25 14:20:51 optisat kernel: [  159.094206] 3790 total pagecache pages
Sep 25 14:20:51 optisat kernel: [  159.094207] 0 pages in swap cache
Sep 25 14:20:51 optisat kernel: [  159.094208] Swap cache stats: add 0, delete 0, find 0/0
Sep 25 14:20:51 optisat kernel: [  159.094209] Free swap  = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.094209] Total swap = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.099045] 849904 pages RAM
Sep 25 14:20:51 optisat kernel: [  159.099046] 622594 pages HighMem
Sep 25 14:20:51 optisat kernel: [  159.099047] 35058 pages reserved
Sep 25 14:20:51 optisat kernel: [  159.099048] 8161 pages shared
Sep 25 14:20:51 optisat kernel: [  159.099048] 202610 pages non-shared
Sep 25 14:20:51 optisat kernel: [  159.099050] Out of memory: kill process 2459 (dbus-daemon) score 743 or a child
Sep 25 14:20:51 optisat kernel: [  159.099114] Killed process 2459 (dbus-daemon)
Sep 25 14:20:51 optisat kernel: [  159.112749] htop invoked oom-killer: gfp_mask=0x800d0, order=0, oom_adj=0
Sep 25 14:20:51 optisat kernel: [  159.112753] htop cpuset=/ mems_allowed=0
Sep 25 14:20:51 optisat kernel: [  159.112755] Pid: 3074, comm: htop Not tainted 2.6.32.61 #18
Sep 25 14:20:51 optisat kernel: [  159.112756] Call Trace:
Sep 25 14:20:51 optisat kernel: [  159.112761]  [<c10919ce>] oom_kill_process+0x9e/0x2c0
Sep 25 14:20:51 optisat kernel: [  159.112764]  [<c1091fcd>] ? select_bad_process+0xad/0xf0
Sep 25 14:20:51 optisat kernel: [  159.112766]  [<c1092053>] __out_of_memory+0x43/0xb0
Sep 25 14:20:51 optisat kernel: [  159.112768]  [<c1092332>] out_of_memory+0x52/0xb0
Sep 25 14:20:51 optisat kernel: [  159.112770]  [<c109517c>] __alloc_pages_nodemask+0x55c/0x570
Sep 25 14:20:51 optisat kernel: [  159.112773]  [<c1101430>] ? proc_info_read+0x0/0xc0
Sep 25 14:20:51 optisat kernel: [  159.112776]  [<c10951a7>] __get_free_pages+0x17/0x30
Sep 25 14:20:51 optisat kernel: [  159.112778]  [<c110146b>] proc_info_read+0x3b/0xc0
Sep 25 14:20:51 optisat kernel: [  159.112780]  [<c1101430>] ? proc_info_read+0x0/0xc0
Sep 25 14:20:51 optisat kernel: [  159.112783]  [<c10bfa34>] vfs_read+0x84/0x180
Sep 25 14:20:51 optisat kernel: [  159.112785]  [<c1101430>] ? proc_info_read+0x0/0xc0
Sep 25 14:20:51 optisat kernel: [  159.112787]  [<c10bfb68>] sys_read+0x38/0x70
Sep 25 14:20:51 optisat kernel: [  159.112789]  [<c1002cd4>] sysenter_do_call+0x12/0x32
Sep 25 14:20:51 optisat kernel: [  159.112790] Mem-Info:
Sep 25 14:20:51 optisat kernel: [  159.112791] DMA per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.112792] CPU    0: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.112794] CPU    1: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.112795] CPU    2: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.112796] CPU    3: hi:    0, btch:   1 usd:   0
Sep 25 14:20:51 optisat kernel: [  159.112797] Normal per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.112798] CPU    0: hi:  186, btch:  31 usd:  53
Sep 25 14:20:51 optisat kernel: [  159.112800] CPU    1: hi:  186, btch:  31 usd: 175
Sep 25 14:20:51 optisat kernel: [  159.112801] CPU    2: hi:  186, btch:  31 usd: 160
Sep 25 14:20:51 optisat kernel: [  159.112802] CPU    3: hi:  186, btch:  31 usd:  57
Sep 25 14:20:51 optisat kernel: [  159.112803] HighMem per-cpu:
Sep 25 14:20:51 optisat kernel: [  159.112804] CPU    0: hi:  186, btch:  31 usd: 172
Sep 25 14:20:51 optisat kernel: [  159.112805] CPU    1: hi:  186, btch:  31 usd: 170
Sep 25 14:20:51 optisat kernel: [  159.112806] CPU    2: hi:  186, btch:  31 usd: 157
Sep 25 14:20:51 optisat kernel: [  159.112807] CPU    3: hi:  186, btch:  31 usd: 113
Sep 25 14:20:51 optisat kernel: [  159.112810] active_anon:4201 inactive_anon:1114 isolated_anon:0
Sep 25 14:20:51 optisat kernel: [  159.112811]  active_file:1394 inactive_file:2326 isolated_file:0
Sep 25 14:20:51 optisat kernel: [  159.112811]  unevictable:0 dirty:92 writeback:0 unstable:0
Sep 25 14:20:51 optisat kernel: [  159.112812]  free:607509 slab_reclaimable:2518 slab_unreclaimable:190569
Sep 25 14:20:51 optisat kernel: [  159.112813]  mapped:1744 shmem:59 pagetables:155 bounce:0
Sep 25 14:20:51 optisat kernel: [  159.112816] DMA free:3460kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15668kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:11592kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
Sep 25 14:20:51 optisat kernel: [  159.112819] lowmem_reserve[]: 0 859 3236 3236
Sep 25 14:20:51 optisat kernel: [  159.112824] Normal free:3500kB min:3716kB low:4644kB high:5572kB active_anon:0kB inactive_anon:0kB active_file:4kB inactive_file:68kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:879840kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:0kB slab_reclaimable:10072kB slab_unreclaimable:750784kB kernel_stack:952kB pagetables:620kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.112828] lowmem_reserve[]: 0 0 19015 19015
Sep 25 14:20:51 optisat kernel: [  159.112832] HighMem free:2423076kB min:512kB low:3080kB high:5652kB active_anon:16804kB inactive_anon:4456kB active_file:5572kB inactive_file:9236kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:2433944kB mlocked:0kB dirty:368kB writeback:0kB mapped:6972kB shmem:236kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:96 all_unreclaimable? no
Sep 25 14:20:51 optisat kernel: [  159.112836] lowmem_reserve[]: 0 0 0 0
Sep 25 14:20:51 optisat kernel: [  159.112838] DMA: 2*4kB 2*8kB 1*16kB 2*32kB 2*64kB 3*128kB 1*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3432kB
Sep 25 14:20:51 optisat kernel: [  159.112844] Normal: 161*4kB 12*8kB 1*16kB 0*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3508kB
Sep 25 14:20:51 optisat kernel: [  159.112850] HighMem: 1440*4kB 802*8kB 471*16kB 211*32kB 101*64kB 36*128kB 5*256kB 1*512kB 2*1024kB 3*2048kB 580*4096kB = 2423200kB
Sep 25 14:20:51 optisat kernel: [  159.112856] 3790 total pagecache pages
Sep 25 14:20:51 optisat kernel: [  159.112857] 0 pages in swap cache
Sep 25 14:20:51 optisat kernel: [  159.112858] Swap cache stats: add 0, delete 0, find 0/0
Sep 25 14:20:51 optisat kernel: [  159.112859] Free swap  = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.112860] Total swap = 1316856kB
Sep 25 14:20:51 optisat kernel: [  159.117742] 849904 pages RAM
Sep 25 14:20:51 optisat kernel: [  159.117743] 622594 pages HighMem
Sep 25 14:20:51 optisat kernel: [  159.117744] 35058 pages reserved
Sep 25 14:20:51 optisat kernel: [  159.117745] 8060 pages shared
Sep 25 14:20:51 optisat kernel: [  159.117746] 202704 pages non-shared
Sep 25 14:20:51 optisat kernel: [  159.117748] Out of memory: kill process 1897 (rpc.statd) score 601 or a child
Sep 25 14:20:51 optisat kernel: [  159.117808] Killed process 1897 (rpc.statd)

There are several reasons you could be hitting a out-of-memory issues, first and foremost being lack of availability of sufficiently large contiguous memory being request by kmem_cache_create(). 造成内存不足问题的原因有很多,首先是kmem_cache_create()请求缺乏足够大的连续内存的可用性。 Note that kmem_cache_create() uses the SLAB layer as I suspect from the output provided. 请注意,我从提供的输出中怀疑kmem_cache_create()使用SLAB层。

From the dmesg output seems to be missing the a line followed by a table similar to the below, this table should give more information about the processes causing the OOM error along with oom_adj score and the resident memory used by the process. dmesg输出中似乎缺少一行,后面是一个类似于以下内容的表,该表应提供有关导致OOM错误的进程的更多信息,以及oom_adj得分和该进程使用的驻留内存。 Higher the oom_adj_score, more likely the process is going to get killed. oom_adj_score越高,该进程被杀死的可能性就越大。

kernel: [ pid ]   uid  tgid total_vm      rss cpu oom_adj oom_score_adj name 

Try the following command instead to get more information in the dmesg output: dmesg -l info,notice,warn,err,crit,alert,emerg 尝试使用以下命令在dmesg输出中获取更多信息:dmesg -l info,notice,warn,err,crit,alert,emerg

Additionally you may also want to consider setting the following in /etc/sysctl.conf file and running sysctl -p (to avoid restart): 另外,您可能还需要考虑在/etc/sysctl.conf文件中设置以下内容并运行sysctl -p (以避免重新启动):

vm.overcommit_memory = 2
vm.overcommit_ratio = 80

Refer to this link 参考此链接

It appears that the system is running 32 bit kernel which may run out of virtual memory addresses even if free RAM is available.看起来系统正在运行 32 位 kernel,即使有可用的可用 RAM,它也可能会用完虚拟 memory 地址。 32 bit kernels can effectively handle up to around 2 GB of real RAM without "interesting" limitations. 32 位内核可以有效地处理高达 2 GB 左右的实际 RAM,而没有“有趣”的限制。

The kernel log line that's interesting here looks like this:此处有趣的 kernel 日志行如下所示:

Sep 25 14:20:51 optisat kernel: [  159.043826] Normal free:2732kB min:3716kB low:4644kB high:5572kB active_anon:0kB inactive_anon:0kB active_file:4kB inactive_file:68kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:879840kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:0kB slab_reclaimable:11056kB slab_unreclaimable:749928kB kernel_stack:952kB pagetables:640kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:28 all_unreclaimable? no

Note the part Normal free:2732kB min:3716kB which says that normal memory zone (the part that fits in 32 bit addressing space) is below the minimum which will stop all user processes that try to request more RAM until some can be freed.请注意Normal free:2732kB min:3716kB部分,它表示正常 memory 区域(适合 32 位寻址空间的部分)低于最小值,这将停止所有尝试请求更多 RAM 的用户进程,直到可以释放一些内存。 So your normal memory zone only has 2.7 MB free when the high memory zone still has 2.4 GB free.因此,当高 memory 区域仍有 2.4 GB 可用空间时,您的正常 memory 区域只有 2.7 MB 可用空间。

The only real way to fix the problem is to upgrade to 64 bit OS but tweaking the system to reduce "normal" memory zone usage might help, too.解决该问题的唯一真正方法是升级到 64 位操作系统,但调整系统以减少“正常”memory 区域使用也可能有所帮助。 For example, some people have noticed that disabling.network adapter hardware acceleration could reduce normal memory zone usage quite a bit.例如,有些人注意到禁用网络适配器硬件加速会大大减少正常的 memory 区域使用量。

Using user mode programs that avoid mmap() and other functions that require big block of virtual memory addresses might help, too.使用避免mmap()和其他需要大块虚拟 memory 地址的函数的用户模式程序也可能有所帮助。 However, because mmap() is not a problem with 64 bit OS and using it usually improves runtime performance, most modern applications actually prefer using mmap() for everything.然而,因为mmap()不是 64 位操作系统的问题并且使用它通常可以提高运行时性能,所以大多数现代应用程序实际上更喜欢对所有内容使用mmap() And that makes using 32 bit OS worse idea with modern OS and applications.这使得在现代操作系统和应用程序中使用 32 位操作系统变得更糟。

Also note that some security features (eg KASRL) require bigger address spaces than 32 bit to be effectively implemented so using a 32 bit OS also reduces security of your system.另请注意,某些安全功能(例如 KASRL)需要比 32 位更大的地址空间才能有效实现,因此使用 32 位操作系统也会降低系统的安全性。

TL;DR: If you need to handle any files bigger than 2 GB or have more than 2 GB of RAM installed on your system, you should be running 64 bit OS. TL;DR:如果您需要处理任何大于 2 GB 的文件或在您的系统上安装超过 2 GB 的 RAM,您应该运行 64 位操作系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM