2008-11-06 17:13:48     page allocation failure

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

2008-11-06 17:13:48     page allocation failure

Wojtek Skulski (UNITED STATES)

Message: 64787   

 

Hi:

 

we are trying to run a fairly large application ICE Server in 64 MB of RAM. (ICE = Internet Communication Engine from http://www.zeroc.com/ ). The "client" side of the app can be loaded into the BlackStamp BF532 board, but the "server" side fails with the following error:

 

root:/hello> ./server --Ice.Config=config

server: page allocation failure. order:8, mode:0x40d0

...

 

Mem-info:

DMA per-cpu:

CPU    0: hi:   18, btch:   3 usd:   0

Active:4511 inactive:2271 dirty:0 writeback:0 unstable:0

free:460 slab:615 mapped:0 pagetables:0 bounce:0

DMA free:1840kB min:1008kB low:1260kB high:1512kB active:18044kB inactive:9084ko

lowmem_reserve[]: 0 0 0

DMA: 22*4kB 3*8kB 2*16kB 1*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 0*2048kB

6782 total pagecache pages

16127 pages of RAM

483 free pages

7272 reserved pages

0 pages shared

0 pages swap cached

Allocation of length 679936 from process 254 failed       <===== SEE THIS?

 

 

I have a few questions.

 

1. Did anyone try running ICE on Blackfin and can share the experience?

 

2. I suspect that ICE Server simply does not fit into the 64 MB memory footprint. Most likely we need to trim the memory usage somewhat before ICE can fit. Any suggestions, which parts of the uCLinux are the best candidates for trimming off?

 

3. Where can I find the memory map of the uCLinux system running on the board in order to locate the memory hogs?

 

Thanks! -- Wojtek

QuoteReplyEditDelete

 

 

2008-11-06 17:23:21     Re: page allocation failure

Mike Frysinger (UNITED STATES)

Message: 64788   

 

the allocator works in power of two, so a 680k request is turned into a 1meg request.  that is what the "order 8" error means: 4096 << 8

 

i doubt trimming any kernel drivers will make a difference at all here

 

/proc/maps and /proc/<pid>/maps tracks all userspace memory mappings

QuoteReplyEditDelete

 

 

2008-11-10 11:37:47     Re: page allocation failure

Garth Kassinger (UNITED STATES)

Message: 64954   

 

Mike:

 

thank you for info. We managed to run the ICE Server after trimming off all extra stuff from the kernel.  We are now trying to determine how much free RAM we still have for other apps. We looked at the /proc/meminfo and it tells us the following:

 

MemTotal: 36708 kB

 

MemFree: 5940 kB

 

It is very puzzling. We know we have 64 MB worth of RAM chips on board. The dmesg is reproduced below and it says "64 MB". We believe this number is from an actual memory test. Therefore, we believe that the kernel knows it has 64 MB. However, the meminfo thinks that it has only 36706 kB. Do you have any idea why the meminfo is not reporting the full amount of RAM?

 

Thank you for any hints! -- Wojtek and Garth

 

root:/> dmesg

Linux version 2.6.26.2-ADI-2009R1-pre-dirty (gkas@lakeway) (gcc version 4.1.2 (8

console [early_BFuart0] enabled

early printk enabled on early_BFuart0

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00196db0

  rodata    = 0x00196dc0-0x002191f4

  bss       = 0x00219200-0x0022cd08

  data      = 0x0022cd20-0x00242000

    stack   = 0x00240000-0x00242000

  init      = 0x00242000-0x01a95000

  available = 0x01a95000-0x03eff000

  DMA Zone  = 0x03f00000-0x04000000

 

QuoteReplyEditDelete

 

 

2008-11-10 11:45:39     Re: page allocation failure

Mike Frysinger (UNITED STATES)

Message: 64956   

 

looks correct to me.  the available line is ~36megs.

 

if you want more space, dont put your root filesystem into RAM ... use external storage.  your root filesystem is sucking up ~22megs.  just like the "init" line indicates.

QuoteReplyEditDelete

 

 

2008-11-10 12:33:50     Re: page allocation failure

Garth Kassinger (UNITED STATES)

Message: 64958   

 

Mike,  thanks a lot. We will do as you are saying. Wojtek and Garth

QuoteReplyEditDelete

 

 

2008-11-10 13:07:20     Re: page allocation failure

Garth Kassinger (UNITED STATES)

Message: 64963   

 

Mike,

 

one more question. Any idea what is taking so much RAM out of 36708 kB so only 5940 kB remains? My understanding is that the RAM disk is sitting somewhere in the kernel memory space. The RAM disk and the kernel together occupy about 28 MB, 22 out of which are the RAM disk. This leaves about 36 MB for user applications. It looks plenty to me. But the meminfo is telling me that about 30 MB of this RAM is taken, and that only 5940 remains. I am puzzling, by what?

 

I should have said that the numbers 36708 kB and 5940 kB were reported just after booting the board, without ICE running yet. The 5940 drops to 1368 kB after we started the ICE server. It turns out that the ICE is not that big after all.

 

What I am aiming at is that maybe it is not the RAM disk what needs to be reduced. There is also this "other stuff" which is eating up 30 MB of RAM. Do you have any idea what this "other stuff" can be or how to find out what it is?

QuoteReplyEditDelete

 

 

2008-11-10 13:15:00     Re: page allocation failure

Mike Frysinger (UNITED STATES)

Message: 64964   

 

you can look at /proc/maps and /proc/<pid>/maps to see what is allocated where

 

really, i would move the root filesystem into external storage first before worrying about memory usage

QuoteReplyEditDelete

 

 

2008-11-11 14:45:37     Re: page allocation failure

Garth Kassinger (UNITED STATES)

Message: 65052   

 

Mike, thanks a lot.

 

we want to get rid of unnecessary stuff from the ramdisk and then shrink it by a few megs. The first step would be to know how much free space there is on the ramdisk. So we typed df and we are not getting any meaningful information.  How can we obtain any useful info about the ramdisk usage? (BTW, the -a is not even listed as a df option in busybox.)

 

root:/> df

Filesystem           1k-blocks      Used Available Use% Mounted on

root:/>

 

root:/> df -a

Filesystem           1k-blocks      Used Available Use% Mounted on

rootfs                       0         0         0   0% /

proc                         0         0         0   0% /proc

sysfs                        0         0         0   0% /sys

mdev                         0         0         0   0% /dev

devpts                       0         0         0   0% /dev/pts

var                          0         0         0   0% /var

tmp                          0         0         0   0% /tmp

debugfs                      0         0         0   0% /sys/kernel/debug

securityfs                   0         0         0   0% /sys/kernel/security

 

QuoteReplyEditDelete

 

 

2008-11-11 15:00:39     Re: page allocation failure

Mike Frysinger (UNITED STATES)

Message: 65053   

 

when embedded is enabled, i dont think tracking is done on pseudo filesystems.  it isnt a bug in busybox as you can verify the output with strace.

 

if you're using the default config, there is no ramdisk.  it's initramfs.  so go into the romfs/ dir and run `du` in there on your host.

QuoteReplyEditDelete

 

 

2008-11-11 15:33:03     Re: page allocation failure

Garth Kassinger (UNITED STATES)

Message: 65055   

 

Mike, thanks. It puts us on the right track. We indeed identified a memory hog we can get rid of. Thanks again.

Attachments

    Outcomes