大家好,
帮忙看一个kernel panic问题把,困扰很久了。
应用场景:车载
测试场景:
我们有一路倒车影像通过CVBS输入到TW8834(video decoder),然后解出来的数据直接丢给IPU去处理显示。
不停的切换倒车影像,有很大几率导致kernel panic,下面是我分析的结果:
我们从panic信息,以及反汇编得出的结果来看
----------------------------------------------------------------------------
/* Fill black color for framebuffer */
tmp = (short *) fbi->screen_base;
c02ac7f4: e5943248 ldr r3, [r4, #584] ; 0x248
for (i = 0; i < (fbi->fix.line_length * fbi->var.yres)/2;
c02ac7f8: e0020291 mul r2, r1, r2
c02ac7fc: e1b020a2 lsrs r2, r2, #1
c02ac800: 0a000007 beq c02ac824 <prpvf_start.part.2+0x16c>
i++, tmp++)
*tmp = color;
c02ac804: e1a00007 mov r0, r7
c02ac808: e0c300b2 strh r0, [r3], #2
cam->win.w.top);
-----------------------------------------------------------------------------
应该是screen_base这个fb buff指针为空导致的,这这个fb buff为什么为空,是因为:
-------------------------------------------------------------------
mxc_sdc_fb mxc_sdc_fb.0: Unable to allocate framebuffer memory
-------------------------------------------------------------------
fb buff申请内存失败,至于为什么申请内存失败,很有可能是系统内存不足。 从我模拟的情况来看,不停在泊车模式和正常模式之间切换,会有很大几率触发lowmemorrykill
下面的日志,虽然没有导致内核panic,但是已经触发lowmemorrykill,说明系统内存已经不够fb buff的申请了
---------------------------------------------------------------------------------------------------------------
[ 1874.945403] dls_reverse_svr: page allocation failure: order:8, mode:0xd1
[ 1874.952213] [<c0046944>] (unwind_backtrace+0x0/0x138) from [<c00c8ac8>] (warn_alloc_failed+0xc8/0x100)
[ 1874.961735] [<c00c8ac8>] (warn_alloc_failed+0xc8/0x100) from [<c00cafe8>] (_alloc_pages_nodemask+0x4c0/0x710)
[ 1874.975785] [<c00cafe8>] (_alloc_pages_nodemask+0x4c0/0x710) from [<c0049a30>] (_dma_alloc+0xa0/0x2fc)
[ 1874.987960] [<c0049a30>] (_dma_alloc+0xa0/0x2fc) from [<c004a268>] (dma_alloc_coherent+0x54/0x60)
[ 1874.997117] [<c004a268>] (dma_alloc_coherent+0x54/0x60) from [<c02ac968>] (prpvf_start.part.2+0x2b0/0x750)
[ 1875.006815] [<c02ac968>] (prpvf_start.part.2+0x2b0/0x750) from [<c02a745c>] (start_preview+0x44/0x184)
[ 1875.016158] [<c02a745c>] (start_preview+0x44/0x184) from [<c02aadcc>] (mxc_v4l_do_ioctl+0x1418/0x28ec)
[ 1875.025627] [<c02aadcc>] (mxc_v4l_do_ioctl+0x1418/0x28ec) from [<c029ac64>] (video_usercopy+0x98/0x4d4)
[ 1875.035051] [<c029ac64>] (video_usercopy+0x98/0x4d4) from [<c029a1fc>] (v4l2_ioctl+0x118/0x148)
[ 1875.044302] [<c029a1fc>] (v4l2_ioctl+0x118/0x148) from [<c0100dfc>] (do_vfs_ioctl+0x84/0x5c0)
[ 1875.053321] [<c0100dfc>] (do_vfs_ioctl+0x84/0x5c0) from [<c0101370>] (sys_ioctl+0x38/0x5c)
[ 1875.061640] [<c0101370>] (sys_ioctl+0x38/0x5c) from [<c003f900>] (ret_fast_syscall+0x0/0x30)
[ 1875.070105] Mem-info:
[ 1875.072385] Normal per-cpu:
[ 1875.075304] CPU 0: hi: 186, btch: 31 usd: 28
[ 1875.080136] CPU 1: hi: 186, btch: 31 usd: 42
[ 1875.084932] HighMem per-cpu:
[ 1875.087817] CPU 0: hi: 186, btch: 31 usd: 22
[ 1875.092638] CPU 1: hi: 186, btch: 31 usd: 64
[ 1875.097544] active_anon:133980 inactive_anon:54 isolated_anon:0
[ 1875.097549] active_file:10986 inactive_file:22094 isolated_file:0
[ 1875.097553] unevictable:112 dirty:0 writeback:0 unstable:0
[ 1875.097557] free:7050 slab_reclaimable:1338 slab_unreclaimable:3127
[ 1875.097561] mapped:14276 shmem:61 pagetables:2483 bounce:0
[ 1875.127350] Normal free:25964kB min:2548kB low:3184kB high:3820kB active_anon:260828kB inactive_anon:12kB active_file:15220kB inactive_file:21756kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:406400kB mlocked:0kB dirty:0kB writeback:0kB mapped:3920kB shmem:12kB slab_reclaimable:5352kB slab_unreclaimable:12508kB kernel_stack:4832kB pagetables:9932kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:21 all_unreclaimable? no
[ 1875.167391] lowmem_reserve[]: 0 2905 2905
[ 1875.171498] HighMem free:2236kB min:360kB low:940kB high:1524kB active_anon:275092kB inactive_anon:204kB active_file:28724kB inactive_file:66172kB unevictable:448kB isolated(anon):0kB isolated(file):0kB present:371840kB mlocked:0kB dirty:0kB writeback:0kB mapped:53184kB shmem:232kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:286 all_unreclaimable? no
[ 1875.210680] lowmem_reserve[]: 0 0 0
[ 1875.214233] Normal: 1085*4kB 273*8kB 118*16kB 53*32kB 25*64kB 27*128kB 24*256kB 12*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 27452kB
[ 1875.228290] HighMem: 217*4kB 23*8kB 8*16kB 5*32kB 4*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 2236kB
[ 1875.241663] 32650 total pagecache pages
[ 1875.270149] 262144 pages of RAM
[ 1875.273431] 8624 free pages
[ 1875.276228] 69677 reserved pages
[ 1875.279459] 4462 slab pages
[ 1875.282284] 150199 pages shared
[ 1875.285428] 0 pages swap cached
[ 1875.288573] Error to allocate vf buffer
[ 1875.563858] select 1741 (externalstorage), adj 15, size 4359, to kill
[ 1875.570370] select 2003 (d.process.media), adj 15, size 5411, to kill
[ 1875.576839] send sigkill to 2003 (d.process.media), adj 15, size 5411
[ 1875.791089] select 1741 (externalstorage), adj 15, size 4359, to kill
[ 1875.797588] select 2179 (.foton.contacts), adj 15, size 4593, to kill
[ 1875.804060] select 2193 (.dls.vuiservice), adj 15, size 7088, to kill
[ 1875.810539] send sigkill to 2193 (.dls.vuiservice), adj 15, size 7088
[ 1876.020133] select 1741 (externalstorage), adj 15, size 4359, to kill
[ 1876.026601] select 2179 (.foton.contacts), adj 15, size 4593, to kill
[ 1876.033097] send sigkill to 2179 (.foton.contacts), adj 15, size 4593
[ 1876.150233] select 1741 (externalstorage), adj 15, size 4359, to kill
[ 1876.156735] send sigkill to 1741 (externalstorage), adj 15, size 4359
[ 1876.460260] select 2133 (timeinitializer), adj 15, size 4261, to kill
[ 1876.466746] send sigkill to 2133 (timeinitializer), adj 15, size 4261
[ 1876.570515] select 2024 (.foton.settings), adj 15, size 4965, to kill
[ 1876.577039] send sigkill to 2024 (.foton.settings), adj 15, size 4965
[ 1876.800280] select 2219 (s.PhoneNumUtils), adj 15, size 4827, to kill
[ 1876.806767] send sigkill to 2219 (s.PhoneNumUtils), adj 15, size 4827
[ 1876.910248] select 2290 (oid.factorymode), adj 15, size 4242, to kill
[ 1876.916740] send sigkill to 2290 (oid.factorymode), adj 15, size 4242
[ 1878.962513] select 2095 (d.process.acore), adj 13, size 5601, to kill
[ 1878.968997] send sigkill to 2095 (d.process.acore), adj 13, size 5601
具体的日至已经上传到附件中,大家看看这个bug搞,需要什么log。
下面是出错代码附近的反汇编:
/* Fill black color for framebuffer */
tmp = (short *) fbi->screen_base;
c02ac7f4: e5943248 ldr r3, [r4, #584] ; 0x248
for (i = 0; i < (fbi->fix.line_length * fbi->var.yres)/2;
c02ac7f8: e0020291 mul r2, r1, r2
c02ac7fc: e1b020a2 lsrs r2, r2, #1
c02ac800: 0a000007 beq c02ac824 <prpvf_start.part.2+0x16c>
i++, tmp++)
*tmp = color;
c02ac804: e1a00007 mov r0, r7
c02ac808: e0c300b2 strh r0, [r3], #2
cam->win.w.top);
/* Fill black color for framebuffer */
tmp = (short *) fbi->screen_base;
for (i = 0; i < (fbi->fix.line_length * fbi->var.yres)/2;
i++, tmp++)
c02ac80c: e2877001 add r7, r7, #1
ipu_disp_set_window_pos(disp_ipu, MEM_FG_SYNC, cam->win.w.left,
cam->win.w.top);
/* Fill black color for framebuffer */
tmp = (short *) fbi->screen_base;
for (i = 0; i < (fbi->fix.line_length * fbi->var.yres)/2;
c02ac810: e5942040 ldr r2, [r4, #64] ; 0x40
c02ac814: e5941108 ldr r1, [r4, #264] ; 0x108
c02ac818: e0020291 mul r2, r1, r2
c02ac81c: e15700a2 cmp r7, r2, lsr #1
c02ac820: 3afffff8 bcc c02ac808 <prpvf_start.part.2+0x150>
i++, tmp++)
*tmp = color; |