AnsweredAssumed Answered

Long running vpu task with memory leak bug on imx6

Question asked by Michael Banditt on Apr 27, 2014
Latest reply on May 22, 2014 by Peter Bauer
Branched to a new discussion

I have an app that shows a long running RTSP stream (h264 encoded). gstreamer pipeline is as follows:

 

gst-launch rtspsrc location=rtsp://axis-cam1/axis-media/media.amp ! rtph264depay ! vpudec low-latency=true ! mfw_isink axis-left=40 axis-top=20 disp-width=960 disp-height=540 sync=false

 

In parallel my app does some other stuff and also play some videos or also short RTSP streams. This works very nice.

 

After about 1,5 hours, though, all temporary gstreamer activities that are started in parallel to the long running task no longer get any VPU memory. This is the error:

 

aiurdemux194:si: page allocation failure: order:11, mode:0xd1

[<8004c944>] (unwind_backtrace+0x0/0xf4) from [<800cf614>] (warn_alloc_failed+0xd4/0x10c)

[<800cf614>] (warn_alloc_failed+0xd4/0x10c) from [<800d2094>] (__alloc_pages_nodemask+0x540/0x6e4)

[<800d2094>] (__alloc_pages_nodemask+0x540/0x6e4) from [<8004f658>] (__dma_alloc+0x9c/0x2fc)

[<8004f658>] (__dma_alloc+0x9c/0x2fc) from [<8004fbf0>] (dma_alloc_coherent+0x60/0x68)

[<8004fbf0>] (dma_alloc_coherent+0x60/0x68) from [<80465260>] (vpu_alloc_dma_buffer+0x2c/0x54)

[<80465260>] (vpu_alloc_dma_buffer+0x2c/0x54) from [<804656ac>] (vpu_ioctl+0x424/0x8c0)

[<804656ac>] (vpu_ioctl+0x424/0x8c0) from [<80111a90>] (do_vfs_ioctl+0x3b4/0x530)

[<80111a90>] (do_vfs_ioctl+0x3b4/0x530) from [<80111c40>] (sys_ioctl+0x34/0x60)

[<80111c40>] (sys_ioctl+0x34/0x60) from [<80045f80>] (ret_fast_syscall+0x0/0x30)

Mem-info:

DMA per-cpu:

CPU    0: hi:   90, btch:  15 usd:  87

CPU    1: hi:   90, btch:  15 usd:  87

CPU    2: hi:   90, btch:  15 usd:   0

CPU    3: hi:   90, btch:  15 usd:  83

Normal per-cpu:

CPU    0: hi:  186, btch:  31 usd:  32

CPU    1: hi:  186, btch:  31 usd:  32

CPU    2: hi:  186, btch:  31 usd:  63

CPU    3: hi:  186, btch:  31 usd:  62

HighMem per-cpu:

CPU    0: hi:   90, btch:  15 usd:  89

CPU    1: hi:   90, btch:  15 usd:  83

CPU    2: hi:   90, btch:  15 usd:  77

CPU    3: hi:   90, btch:  15 usd:  78

active_anon:9812 inactive_anon:35 isolated_anon:0

active_file:15255 inactive_file:8527 isolated_file:0

unevictable:0 dirty:0 writeback:0 unstable:2

free:386119 slab_reclaimable:411 slab_unreclaimable:1799

mapped:5509 shmem:48 pagetables:219 bounce:0

DMA free:71672kB min:616kB low:768kB high:924kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolateds

lowmem_reserve[]: 0 1244 1593 1593

Normal free:1249804kB min:4212kB low:5264kB high:6316kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB o

lowmem_reserve[]: 0 0 2794 2794

HighMem free:223000kB min:348kB low:640kB high:936kB active_anon:39248kB inactive_anon:140kB active_file:61020kB inactive_file:34108kB unevio

lowmem_reserve[]: 0 0 0 0

DMA: 22*4kB 90*8kB 21*16kB 82*32kB 7*64kB 137*128kB 69*256kB 3*512kB 8*1024kB 5*2048kB 3*4096kB 0*8192kB 0*16384kB 0*32768kB = 71672kB

Normal: 1*4kB 53*8kB 16*16kB 6*32kB 6*64kB 4*128kB 1*256kB 1*512kB 2*1024kB 2*2048kB 3*4096kB 2*8192kB 4*16384kB 35*32768kB = 1249772kB

HighMem: 14*4kB 10*8kB 437*16kB 386*32kB 374*64kB 27*128kB 10*256kB 7*512kB 8*1024kB 7*2048kB 4*4096kB 2*8192kB 1*16384kB 3*32768kB = 223000B

23829 total pagecache pages

0 pages in swap cache

Swap cache stats: add 0, delete 0, find 0/0

Free swap  = 0kB

Total swap = 0kB

524288 pages of RAM

387015 free pages

73287 reserved pages

1169 slab pages

8545 pages shared

0 pages swap cached

Physical memory allocation error!

Physical memory allocation error!

Alignment trap: multiqueue194:s (5204) PC=0x3ae495b4 Instr=0xe8810018 Address=0x00002a0f FSR 0x801

 

or this:

 

rtpjitterbuffer: page allocation failure: order:11, mode:0xd1

[<8004c944>] (unwind_backtrace+0x0/0xf4) from [<800cf614>] (warn_alloc_failed+0xd4/0x10c)

[<800cf614>] (warn_alloc_failed+0xd4/0x10c) from [<800d2094>] (__alloc_pages_nodemask+0x540/0x6e4)

[<800d2094>] (__alloc_pages_nodemask+0x540/0x6e4) from [<8004f658>] (__dma_alloc+0x9c/0x2fc)

[<8004f658>] (__dma_alloc+0x9c/0x2fc) from [<8004fbf0>] (dma_alloc_coherent+0x60/0x68)

[<8004fbf0>] (dma_alloc_coherent+0x60/0x68) from [<80465260>] (vpu_alloc_dma_buffer+0x2c/0x54)

[<80465260>] (vpu_alloc_dma_buffer+0x2c/0x54) from [<804656ac>] (vpu_ioctl+0x424/0x8c0)

[<804656ac>] (vpu_ioctl+0x424/0x8c0) from [<80111a90>] (do_vfs_ioctl+0x3b4/0x530)

[<80111a90>] (do_vfs_ioctl+0x3b4/0x530) from [<80111c40>] (sys_ioctl+0x34/0x60)

[<80111c40>] (sys_ioctl+0x34/0x60) from [<80045f80>] (ret_fast_syscall+0x0/0x30)

Mem-info:

DMA per-cpu:

CPU    0: hi:   90, btch:  15 usd:   0

CPU    1: hi:   90, btch:  15 usd:   0

CPU    2: hi:   90, btch:  15 usd:   0

CPU    3: hi:   90, btch:  15 usd:   0

Normal per-cpu:

CPU    0: hi:  186, btch:  31 usd:   0

CPU    1: hi:  186, btch:  31 usd:   0

CPU    2: hi:  186, btch:  31 usd:   0

CPU    3: hi:  186, btch:  31 usd:   0

HighMem per-cpu:

CPU    0: hi:   90, btch:  15 usd:  14

CPU    1: hi:   90, btch:  15 usd:   0

CPU    2: hi:   90, btch:  15 usd:   0

CPU    3: hi:   90, btch:  15 usd:   0

active_anon:10583 inactive_anon:35 isolated_anon:0

active_file:4074 inactive_file:7742 isolated_file:0

unevictable:0 dirty:1 writeback:0 unstable:0

free:397922 slab_reclaimable:398 slab_unreclaimable:1788

mapped:5165 shmem:47 pagetables:227 bounce:0

DMA free:70760kB min:616kB low:768kB high:924kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolatedo

lowmem_reserve[]: 0 1244 1593 1593

Normal free:1251960kB min:4212kB low:5264kB high:6316kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB o

lowmem_reserve[]: 0 0 2794 2794

HighMem free:268968kB min:348kB low:640kB high:936kB active_anon:42332kB inactive_anon:140kB active_file:16296kB inactive_file:30968kB unevio

lowmem_reserve[]: 0 0 0 0

DMA: 28*4kB 91*8kB 26*16kB 86*32kB 5*64kB 131*128kB 68*256kB 3*512kB 10*1024kB 4*2048kB 3*4096kB 0*8192kB 0*16384kB 0*32768kB = 70760kB

Normal: 113*4kB 58*8kB 40*16kB 17*32kB 4*64kB 2*128kB 1*256kB 2*512kB 1*1024kB 1*2048kB 2*4096kB 3*8192kB 4*16384kB 35*32768kB = 1252148kB

HighMem: 269*4kB 315*8kB 268*16kB 35*32kB 1*64kB 60*128kB 21*256kB 0*512kB 1*1024kB 2*2048kB 1*4096kB 1*8192kB 2*16384kB 6*32768kB = 268908kB

11863 total pagecache pages

0 pages in swap cache

Swap cache stats: add 0, delete 0, find 0/0

Free swap  = 0kB

Total swap = 0kB

524288 pages of RAM

398106 free pages

73287 reserved pages

1142 slab pages

8331 pages shared

0 pages swap cached

Physical memory allocation error!

Physical memory allocation error!

 

I am using kernel 3.0.35 from yocto on a cubox-i4pro device.

 

vpudec versions

    plugin: 3.0.10

    wrapper: 1.0.45(VPUWRAPPER_ARM_LINUX Build on Apr 15 2014 09:52:34)

    vpulib: 5.4.20

    firmware: 2.3.10.40778

 

The same happens when I use a long running vpu encode job without display element (instead of a decode job). If the gstreamer pipeline does not include a VPU element there is no problem.

 

This seems to be a memory leak problem, I guess? Where should I report it? Is there an official bug tracker?

Outcomes