2008-06-04 13:28:12 memory allocation failure
Linux Newbie (INDIA)
Message: 56686
Hi,
The following steps are performed before executing the application
1. uImage is booted
2. Application is compiled seperately(not as part of uImage) and through ftp, we are copying the executable
In our application we use some malloc's and after few malloc's it is failing. Here with I have pasted the call trace.
We have 64MB of SDRAM and for RAMfs we allocated 16MB. Is it advisable to do malloc for arond 1MB ?
Please suggest what went wrong with below trace.
page allocation failure. order:8, mode:0x40d0
Hardware Trace:
0 Target : <0x003035c0> { _dump_stack + 0x0 }
Source : <0x0032ff6a> { ___alloc_pages + 0x17a }
t_I
_I_G_Wadlhl3o0clab>e 0{ C:u < 0
_Mp aeggets2 0+
t M0_xE1D7RaR S}
ch n e SromuIrGcReN E:E <0TxP0t0 3M0_bE4D5R2R>D _{E O_IpGr
intk + 0x16 }
2 Target : <0x0030b44e> { _printk + 0x12 }
Source : <0x0030b2dc> { _vprintk + 0x1b0 }
3 Target : <0x0030b2d0> { _vprintk + 0x1a4 }
Source : <0xffa0117a> { __common_int_entry + 0xd8 }
4 Target : <0xffa01118> { __common_int_entry + 0x76 }
Source : <0xffa00ef0> { _return_from_int + 0x58 }
5 Target : <0xffa00ef0> { _return_from_int + 0x58 }
Source : <0xffa00ec6> { _return_from_int + 0x2e }
6 Target : <0xffa00e98> { _return_from_int + 0x0 }
Source : <0xffa01114> { __common_int_entry + 0x72 }
7 Target : <0xffa01112> { __common_int_entry + 0x70 }
Source : <0xffa0048a> { _asm_do_IRQ + 0x76 }
8 Target : <0xffa00482> { _asm_do_IRQ + 0x6e }
Source : <0x0030f8cc> { _irq_exit + 0x2c }
9 Target : <0x0030f8a0> { _irq_exit + 0x0 }
Source : <0xffa0047e> { _asm_do_IRQ + 0x6a }
10 Target : <0xffa0047e> { _asm_do_IRQ + 0x6a }
Source : <0xffa00f0e> { _evt14_softirq + 0x6 }
11 Target : <0xffa00f08> { _evt14_softirq + 0x0 }
Source : <0xffa00f06> { _lower_to_irq14 + 0x12 }
12 Target : <0xffa00ef4> { _lower_to_irq14 + 0x0 }
Source : <0xffa0047a> { _asm_do_IRQ + 0x66 }
13 Target : <0xffa00458> { _asm_do_IRQ + 0x44 }
Source : <0x00325be4> { _handle_simple_irq + 0x6c }
14 Target : <0x00325bd8> { _handle_simple_irq + 0x60 }
Source : <0x00325bee> { _handle_simple_irq + 0x76 }
15 Target : <0x00325bee> { _handle_simple_irq + 0x76 }
Source : <0x00325532> { _note_interrupt + 0x3a }
Stack from 028eddd8:
00000001 0032ff6e 00000000 00000001 000040d0 006fc1cc 00000008 000040d0
00000000 00000080 00000000 000240d0 00000000 028ec000 028ec000 028ec000
00000010 00000000 005e8d80 00330f7e 0045ad14 00000000 0067e920 00000020
000040d0 00000001 00000010 028e9c58 0046296c 000d4000 000040d0 0067e920
000c6fff 0033122e 000c6000 02ce7380 04000073 0000ffff 04000021 00000000
00000000 000d4000 0032e702 000c6000 0032eafa 00000000 028e9c9c ffa029d6
Call Trace:
[<00302d40>] _sys_mmap2+0x48/0x80
[<00302cf8>] _sys_mmap2+0x0/0x80
Mem-info:
DMA per-cpu:
CPU 0: Hot: hi: 6, btch: 1 usd: 1 Cold: hi: 2, btch: 1 usd: 1
Active:1781 inactive:647 dirty:695 writeback:0 unstable:0 free:346 slab:7804 mapped:0 pagetables:0
DMA free:1384kB min:880kB low:1100kB high:1320kB active:7124kB inactive:2588kB present:48768kB pages
_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0
DMA: 22*4kB 6*8kB 2*16kB 2*32kB 0*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB 0*8192kB 0
*16384kB 0*32768kB = 1384kB
12288 pages of RAM
377 free pages
1642 reserved pages
1772 pages shared
0 pages swap cached
Allocation of length 811008 from process 95 failed
DMA per-cpu:
CPU 0: Hot: hi: 6, btch: 1 usd: 1 Cold: hi: 2, btch: 1 usd: 1
Active:1781 inactive:647 dirty:695 writeback:0 unstable:0 free:346 slab:7804 mapped:0 pagetables:0
DMA free:1384kB min:880kB low:1100kB high:1320kB active:7124kB inactive:2588kB present:48768kB pages
_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0
DMA: 22*4kB 6*8kB 2*16kB 2*32kB 0*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB 0*8192kB 0
*16384kB 0*32768kB = 1384kB
QuoteReplyEditDelete
2008-06-04 16:29:22 Re: memory allocation failure
Mike Frysinger (UNITED STATES)
Message: 56693
your memory is too fragmented to satisfy the large allocation, just like the error message says:
page allocation failure. order:8, mode:0x40d0
DMA: 22*4kB 6*8kB 2*16kB 2*32kB 0*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 1384kB
you should do all your large allocations at the beginning and then not release them, otherwise you will get failures such as this later on