1 [20220707-022639][23457.059849] ptz_task invoked oom-killer: gfp_mask=0x24200ca(GFP_HIGHUSER_MOVABLE), nodemask=0, order=0, oom_score_adj=0
2 [20220707-022639][23457.079399] CPU: 0 PID: 732 Comm: ptz_task Not tainted 4.9.191 #4
3 [20220707-022639][23457.104264] Hardware name: sun8iw21
4 [20220707-022639][23457.108272] Function entered at [<c0010b65>] from [<c000f42f>]
5 [20220707-022639][23457.116676] Function entered at [<c000f42f>] from [<c007353d>]
6 [20220707-022639][23457.123596] Function entered at [<c007353d>] from [<c0050373>]
7 [20220707-022639][23457.135473] Function entered at [<c0050373>] from [<c005095f>]
8 [20220707-022639][23457.142038] Function entered at [<c005095f>] from [<c0052ec3>]
9 [20220707-022639][23457.154611] Function entered at [<c0052ec3>] from [<c004d39d>]
10 [20220707-022639][23457.161183] Function entered at [<c004d39d>] from [<c004e217>]
11 [20220707-022639][23457.177588] Function entered at [<c004e217>] from [<c0063f73>]
12 [20220707-022639][23457.184416] Function entered at [<c0063f73>] from [<c0065fab>]
13 [20220707-022639][23457.191060] Function entered at [<c0065fab>] from [<c00132a1>]
14 [20220707-022639][23457.213017] Function entered at [<c00132a1>] from [<c0009255>]
15 [20220707-022639][23457.230228] Function entered at [<c0009255>] from [<c00100fb>]
16 [20220707-022639][23457.239501] Exception stack(0xc12a3fb0 to 0xc12a3ff8)
17 [20220707-022639][23457.254107] 3fa0: 00000000 00000000 00000000 00000000
18 [20220707-022639][23457.263337] 3fc0: 00000000 00000000 00000000 00000000 00635a4c 00635b64 00000000 00000000
19 [20220707-022639][23457.292522] 3fe0: b54d7c40 b54d7cb8 00080810 0007f304 00000010 ffffffff
20 [20220707-022639][23457.305213] Mem-Info:
21 [20220707-022639][23457.307783] active_anon:4384 inactive_anon:4 isolated_anon:0
22 [20220707-022639][23457.307783] active_file:662 inactive_file:732 isolated_file:64
23 [20220707-022639][23457.307783] unevictable:9 dirty:0 writeback:0 unstable:0
24 [20220707-022639][23457.307783] slab_reclaimable:253 slab_unreclaimable:1373
25 [20220707-022639][23457.307783] mapped:227 shmem:86 pagetables:79 bounce:0
26 [20220707-022639][23457.307783] free:127 free_pcp:2 free_cma:0
27 [20220707-022639][23457.383542] Node 0 active_anon:17536kB inactive_anon:16kB active_file:2648kBinactive_file:2876kB unevictable:36kB isolated(anon):0kB isolated(file):308kB mapped:908kB dirty:0kB writeback:0kB shmem:344kB writeback_tmp:0kB unstable:0kB pages_scanned:56785 all_unreclaimable? no
28 [20220707-022639][23457.430530] Normal free:508kB min:512kB low:1124kB high:1252kB active_anon:17536kB inactive_anon:16kB active_file:2648kB inactive_file:2928kB unevictable:36kB writepending:0kB present:65536kBmanaged:61480kB mlocked:36kB slab_reclaimable:1012kB slab_unreclaimable:5492 kB kernel_stack:1040kB pagetables:316kB bounce:0kB free_pcp:8kB local_pcp:8kB free_cma:0kB
29 [20220707-022639][23457.496173] lowmem_reserve[]: 0 0
30 [20220707-022639][23457.500030] Normal: 109*4kB (UME) 9*8kB (U) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB
31 [20220707-022639][23457.524995] 1544 total pagecache pages
32 [20220707-022639][23457.529288] 16384 pages RAM
33 [20220707-022639][23457.532556] 0 pages HighMem/MovableOnly
34 [20220707-022639][23457.547845] 1014 pages reserved
35 [20220707-022639][23457.551958] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
36 [20220707-022639][23457.577207] [ 632] 0 632 254 41 3 0 0 0 telnetd
37 [20220707-022639][23457.587485] [ 633] 0 633 232 43 3 0 0 0 adbd
38 [20220707-022639][23457.607393] [ 657] 0 657 585 72 4 0 0 0 wpa_supplicant
39 [20220707-022639][23457.628416] [ 660] 0 660 254 36 3 0 0 0 telnetd
40 [20220707-022639][23457.641304] [ 673] 0 673 244 48 3 0 0 0 sk_srv_syscall
41 [20220707-022639][23457.662083] [ 676] 0 676 17203 4349 35 0 0 0 skyapp
42 [20220707-022639][23457.682194] [ 677] 0 677 254 41 3 0 0 0 exe
43 [20220707-022639][23457.698911] [ 899] 0 899 1056 97 6 0 0 0 skmongoose
44 [20220707-022639][23457.712344] [ 900] 0 900 254 41 3 0 0 0 clearCached.sh
45 [20220707-022639][23457.733172] [ 921] 0 921 254 33 3 0 0 0 udhcpc
46 [20220707-022639][23457.752165] [ 1210] 0 1210 254 42 3 0 0 0 ash
47 [20220707-022639][23457.762516] [11670] 0 11670 254 41 3 0 0 0 sleep
48 [20220707-022639][23457.773158] [12021] 0 12021 228 24 3 0 0 0 sleep
49 [20220707-022639][23457.788033] [12023] 0 12023 244 48 3 0 0 0 sk_srv_syscall
50 [20220707-022639][23457.819352] Out of memory: Kill process 676 (skyapp) score 276 or sacrifice child
51 [20220707-022639][23457.838273] Killed process 676 (skyapp) total-vm:68812kB, anon-rss:16536kB, file-rss:820kB, shmem-rss:40kB
52 [20220707-022639][23457.882911] oom_reaper: reaped process 676 (skyapp), now anon-rss:0kB, file-rss:0kB, shmem-rss:40kB
1 [20220707-022639][23457.059849] ptz_task invoked oom-killer: gfp_mask=0x24200ca(GFP_HIGHUSER_MOVABLE), nodemask=0, order=0, oom_score_adj=0
2 [20220707-022639][23457.079399] CPU: 0 PID: 732 Comm: ptz_task Not tainted 4.9.191 #4
3 [20220707-022639][23457.104264] Hardware name: sun8iw21
4 [20220707-022639][23457.108272] Function entered at [<c0010b65>] from [<c000f42f>]
5 [20220707-022639][23457.116676] Function entered at [<c000f42f>] from [<c007353d>]
6 [20220707-022639][23457.123596] Function entered at [<c007353d>] from [<c0050373>]
7 [20220707-022639][23457.135473] Function entered at [<c0050373>] from [<c005095f>]
8 [20220707-022639][23457.142038] Function entered at [<c005095f>] from [<c0052ec3>]
9 [20220707-022639][23457.154611] Function entered at [<c0052ec3>] from [<c004d39d>]
10 [20220707-022639][23457.161183] Function entered at [<c004d39d>] from [<c004e217>]
11 [20220707-022639][23457.177588] Function entered at [<c004e217>] from [<c0063f73>]
12 [20220707-022639][23457.184416] Function entered at [<c0063f73>] from [<c0065fab>]
13 [20220707-022639][23457.191060] Function entered at [<c0065fab>] from [<c00132a1>]
14 [20220707-022639][23457.213017] Function entered at [<c00132a1>] from [<c0009255>]
15 [20220707-022639][23457.230228] Function entered at [<c0009255>] from [<c00100fb>]
16 [20220707-022639][23457.239501] Exception stack(0xc12a3fb0 to 0xc12a3ff8)
17 [20220707-022639][23457.254107] 3fa0: 00000000 00000000 00000000 00000000
18 [20220707-022639][23457.263337] 3fc0: 00000000 00000000 00000000 00000000 00635a4c 00635b64 00000000 00000000
19 [20220707-022639][23457.292522] 3fe0: b54d7c40 b54d7cb8 00080810 0007f304 00000010 ffffffff
20 [20220707-022639][23457.305213] Mem-Info:
21 [20220707-022639][23457.307783] active_anon:4384 inactive_anon:4 isolated_anon:0
22 [20220707-022639][23457.307783] active_file:662 inactive_file:732 isolated_file:64
23 [20220707-022639][23457.307783] unevictable:9 dirty:0 writeback:0 unstable:0
24 [20220707-022639][23457.307783] slab_reclaimable:253 slab_unreclaimable:1373
25 [20220707-022639][23457.307783] mapped:227 shmem:86 pagetables:79 bounce:0
26 [20220707-022639][23457.307783] free:127 free_pcp:2 free_cma:0
27 [20220707-022639][23457.383542] Node 0 active_anon:17536kB inactive_anon:16kB active_file:2648kBinactive_file:2876kB unevictable:36kB isolated(anon):0kB isolated(file):308kB mapped:908kB dirty:0kB writeback:0kB shmem:344kB writeback_tmp:0kB unstable:0kB pages_scanned:56785 all_unreclaimable? no
28 [20220707-022639][23457.430530] Normal free:508kB min:512kB low:1124kB high:1252kB active_anon:17536kB inactive_anon:16kB active_file:2648kB inactive_file:2928kB unevictable:36kB writepending:0kB present:65536kBmanaged:61480kB mlocked:36kB slab_reclaimable:1012kB slab_unreclaimable:5492 kB kernel_stack:1040kB pagetables:316kB bounce:0kB free_pcp:8kB local_pcp:8kB free_cma:0kB
29 [20220707-022639][23457.496173] lowmem_reserve[]: 0 0
30 [20220707-022639][23457.500030] Normal: 109*4kB (UME) 9*8kB (U) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 508kB
第28行,输出内存管理区中的空闲页面数量
第29行,输出内存管理区中的lowmem_reserve成员的值(lowmem_reserve[]: 0 0),它用于保证低端内存管理区的内存不会被进程恶意占用。
第30行,输出内存管理区中每个链表中的迁移类型情况,如“109*4kB (UME)”表示order为0的空闲链表中,共109个成员。累加后总大小508kB。
31 [20220707-022639][23457.524995] 1544 total pagecache pages
32 [20220707-022639][23457.529288] 16384 pages RAM
33 [20220707-022639][23457.532556] 0 pages HighMem/MovableOnly
34 [20220707-022639][23457.547845] 1014 pages reserved
35 [20220707-022639][23457.551958] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
36 [20220707-022639][23457.577207] [ 632] 0 632 254 41 3 0 0 0 telnetd
37 [20220707-022639][23457.587485] [ 633] 0 633 232 43 3 0 0 0 adbd
38 [20220707-022639][23457.607393] [ 657] 0 657 585 72 4 0 0 0 wpa_supplicant
39 [20220707-022639][23457.628416] [ 660] 0 660 254 36 3 0 0 0 telnetd
40 [20220707-022639][23457.641304] [ 673] 0 673 244 48 3 0 0 0 sk_srv_syscall
41 [20220707-022639][23457.662083] [ 676] 0 676 17203 4349 35 0 0 0 skyapp
42 [20220707-022639][23457.682194] [ 677] 0 677 254 41 3 0 0 0 exe
43 [20220707-022639][23457.698911] [ 899] 0 899 1056 97 6 0 0 0 skmongoose
44 [20220707-022639][23457.712344] [ 900] 0 900 254 41 3 0 0 0 clearCached.sh
45 [20220707-022639][23457.733172] [ 921] 0 921 254 33 3 0 0 0 udhcpc
46 [20220707-022639][23457.752165] [ 1210] 0 1210 254 42 3 0 0 0 ash
47 [20220707-022639][23457.762516] [11670] 0 11670 254 41 3 0 0 0 sleep
48 [20220707-022639][23457.773158] [12021] 0 12021 228 24 3 0 0 0 sleep
49 [20220707-022639][23457.788033] [12023] 0 12023 244 48 3 0 0 0 sk_srv_syscall
50 [20220707-022639][23457.819352] Out of memory: Kill process 676 (skyapp) score 276 or sacrifice child
51 [20220707-022639][23457.838273] Killed process 676 (skyapp) total-vm:68812kB, anon-rss:16536kB, file-rss:820kB, shmem-rss:40kB
52 [20220707-022639][23457.882911] oom_reaper: reaped process 676 (skyapp), now anon-rss:0kB, file-rss:0kB, shmem-rss:40kB
第35~49行,输出系统所欲可选的进程的相关信息
第50行,OOM Killer机制会选择占用物理内存最多的进程作为候选者,通过比较发现PID为676的进程(skyapp进程)为最佳选择,因此输出“Out of memory: Kill process 676 (skyapp) score 276 or sacrifice child”。
第51~52行,比较候选者中的线程,选择一个占用内存最多的线程作为最终候选者,通过比较发现wicd-monitor线程(PID为676)占用内存最多,因此最终选择该线程来终止。