2011-02-27 22:34:20     Some times system with enough free mememry,but prompt to page allocation failure

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-02-27 22:34:20     Some times system with enough free mememry,but prompt to page allocation failure

Bill Xie (CHINA)

Message: 98460   

 

Hi,

 

    The same application  work fine in mostly,but some times when app running prompt to page allocation failure.

 

Before app running, the system free memery is much more than my program malloc memery. my system is bf518-2.6.34.7-ADI-2010R1.

 

/mnt/bin # free

              total         used         free       shared      buffers

  Mem:        29168         4668        24500            0           56

 

/mnt/bin # ./ebox

2011-02-28 09:16:59 0x400       ebox              open. alloc memory 1939200 for voice fifo ...

ebox: page allocation failure. order:10, mode:0xd0

Hardware Trace:

   0 Target : <0x0012f2e4> { _dump_stack + 0x0 }

     Source : <0x00035c22> { ___alloc_pages_nodemask + 0x3ba } CALL pcrel

   1 Target : <0x00035c22> { ___alloc_pages_nodemask + 0x3ba }

     Source : <0x0012f3dc> { _printk + 0x14 } RTS

   2 Target : <0x0012f3d8> { _printk + 0x10 }

     Source : <0x00010ace> { _vprintk + 0x2da } RTS

   3 Target : <0x00010aac> { _vprintk + 0x2b8 }

     Source : <0x000105c4> { _release_console_sem + 0x190 } RTS

   4 Target : <0x000105bc> { _release_console_sem + 0x188 }

     Source : <0x000105ae> { _release_console_sem + 0x17a } IF CC JUMP pcrel

   5 Target : <0x0001059e> { _release_console_sem + 0x16a }

     Source : <0x00010590> { _release_console_sem + 0x15c } IF CC JUMP pcrel (BP)

   6 Target : <0x0001058a> { _release_console_sem + 0x156 }

     Source : <0x00021aa0> { _up + 0x40 } RTS

   7 Target : <0x00021a9a> { _up + 0x3a }

     Source : <0x00021a8c> { _up + 0x2c } IF CC JUMP pcrel (BP)

   8 Target : <0x00021a86> { _up + 0x26 }

     Source : <0x00021a7e> { _up + 0x1e } JUMP.S

   9 Target : <0x00021a60> { _up + 0x0 }

     Source : <0x00010586> { _release_console_sem + 0x152 } JUMP.L

  10 Target : <0x00010572> { _release_console_sem + 0x13e }

     Source : <0x000104ac> { _release_console_sem + 0x78 } IF CC JUMP pcrel

  11 Target : <0x00010482> { _release_console_sem + 0x4e }

     Source : <0x00010562> { _release_console_sem + 0x12e } IF CC JUMP pcrel (BP)

  12 Target : <0x0001055c> { _release_console_sem + 0x128 }

     Source : <0x0001007e> { __call_console_drivers + 0x72 } RTS

  13 Target : <0x00010078> { __call_console_drivers + 0x6c }

     Source : <0x00010042> { __call_console_drivers + 0x36 } IF CC JUMP pcrel

  14 Target : <0x00010032> { __call_console_drivers + 0x26 }

     Source : <0x00010022> { __call_console_drivers + 0x16 } IF CC JUMP pcrel (BP)

  15 Target : <0x0001000c> { __call_console_drivers + 0x0 }

     Source : <0x00010558> { _release_console_sem + 0x124 } CALL pcrel

Stack info:

SP: [0x00327dbc] <0x00327dbc> /* kernel dynamic memory */

FP: (0x00327eec)

Memory from 0x00327db0 to 00328000

00327db0: 000000d0  00327dbc  00000040 [00000000] 00035c26  01043080  00000000  000000d0

00327dd0: 01043260  0000000a  000000d0  00000001  00000040  00239428  00000000  00326008

00327df0: 00000010  00000050  00000040  00326000  00326000  00000010  000200d0  00000000

00327e10: 00239e58  01043080  0000002c  00239428  00000000  00000000  00000000  00239428

00327e30: 00316000  0003d43a  001c182c  00b99e6c  00b9863c  0000000a  00000073  00000000

00327e50: 00000003  ffa01086  01003560  00239e54  00000000  00316000  0119fe60  00000000

00327e70: 00000000  0003d8e0  001c182c  00b99e6c  00b9863c  00000003  00000073  00000000

00327e90: 00000003  0119fe60  00d57208  00000002  00000004  04000021  00000000  00327eb0

00327eb0: 00000004  00d76e4c  0003daa8  00000000  00316000  00d3f1f0  00326000  00000000

00327ed0: 04000021  00000003  7fffffff  00d57200  00316000  00000003  04000021 (00000000)

00327ef0:<00008fa6> 0003da50  000000c0  00000000  ffffe000  00000000  00000000  00000005

00327f10: 00d20068  0000fffe  04000021  00000000  00000000  00cd3f48 <00008000> 00000000

00327f30: 00000000  00328000  00cd3f48  00cd3f48  00cd1f16  ffa00654  02001025  00cd5b89

00327f50: 00cc49d7  00cd5b3e  00cc49d6  00000000  00000000  0000c800  00000000  0000c800

00327f70: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

00327f90: 00000000  00000000  00000000  00000000  00000008  003084fc  0000000f  00000001

00327fb0: 00000000  00d76e40  00d76e4c  017495f4  00d574f8  00d3f1f0  00000000  00000420

00327fd0: 000000c0  00316000  017493d0  00000000  00000000  04000021  00000003  00316000

00327ff0: 00000000  00000000  000000c0  00000006

Return addresses in stack:

   frame  1 : <0x00008fa6> { _system_call + 0x6a }

    address : <0x00008000> { __sram_alloc + 0x48 }

Mem-Info:

DMA per-cpu:

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

active_anon:0 inactive_anon:0 isolated_anon:0

active_file:11 inactive_file:2 isolated_file:0

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

free:5553 slab_reclaimable:155 slab_unreclaimable:315

mapped:0 shmem:0 pagetables:0 bounce:0

DMA free:22212kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anon:0kB active_file:44kB inactive_file:8kB unevictable:1236kB isolated(anon):0kB isolated(file):0kB present:31496kB mlocked:0kB dirty:8kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:620kB slab_unreclaimable:1260kB kernel_stack:192kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0

DMA: 33*4kB 34*8kB 25*16kB 25*32kB 6*64kB 8*128kB 13*256kB 9*512kB 5*1024kB 3*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 22212kB

322 total pagecache pages

7936 pages RAM

644 pages reserved

257 pages shared

1458 pages non-shared

Allocation of length 3235840 from process 181 (ebox) failed

DMA per-cpu:

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

active_anon:0 inactive_anon:0 isolated_anon:0

active_file:11 inactive_file:2 isolated_file:0

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

free:5553 slab_reclaimable:155 slab_unreclaimable:315

mapped:0 shmem:0 pagetables:0 bounce:0

DMA free:22212kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anon:0kB active_file:44kB inactive_file:8kB unevictable:1236kB isolated(anon):0kB isolated(file):0kB present:31496kB mlocked:0kB dirty:8kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:620kB slab_unreclaimable:1260kB kernel_stack:192kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0

DMA: 33*4kB 34*8kB 25*16kB 25*32kB 6*64kB 8*128kB 13*256kB 9*512kB 5*1024kB 3*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 22212kB

322 total pagecache pages

terminate called after throwing an insbanfe if n-wdt: Unexpected close, not stopping watchdog!

std::bad_alloc'

  what():  std::bad_alloc

ABRT

 

   The system have 24M free memery, my program is only request malloc 3235840 bytes. The free memery must with contiguous chunk for malloc. When system reboot, the app also work fine.

 

Thank you.

QuoteReplyEditDelete

 

 

2011-02-28 11:00:59     Re: Some times system with enough free mememry,but prompt to page allocation failure

Mike Frysinger (UNITED STATES)

Message: 98472   

 

please search the wiki for fragmentation.  you do not have any contiguous chunks nearly large enough to satisfy the request.

 

short answer: dont attempt large allocs after running for a while

QuoteReplyEditDelete

 

 

2011-03-01 05:24:50     Re: Some times system with enough free mememry,but prompt to page allocation failure

Bill Xie (CHINA)

Message: 98501   

 

Thank you for reply. I can request many times to alloc small memory to replace alloc large memory . The size of my application placing in sd card  is 1.5M. but some times the exe load to memory to run also prompt page allocation failure,the exe is not executed.

QuoteReplyEditDelete

 

 

2011-03-01 06:06:38     Re: Some times system with enough free mememry,but prompt to page allocation failure

Mike Frysinger (UNITED STATES)

Message: 98502   

 

unfortunately, the answer is pretty much the same thing.  break it up into smaller shared libraries so that it can be loaded up in a more fragmented system, or, daemonize the process and never quit.

QuoteReplyEditDelete

 

 

2011-03-01 20:42:48     Re: Some times system with enough free mememry,but prompt to page allocation failure

Bill Xie (CHINA)

Message: 98509   

 

Thank you.

QuoteReplyEditDelete

Attachments

    Outcomes