Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Out of Memory

Altera_Forum
Honored Contributor II
1,317 Views

I've been fighting with my flash on a custom board for the last 2 days. I could not mount mtdblock0, turned out to be a problem with busybox. I got over that hurdle only to find a memory allocation problem, and I don't understand why. I have 4Mbytes of SRAM for the kernel and processes to run. Anybody see anything wrong? I will also get error messages when using simple command line arguments like "ls." 

 

ls: page allocation failure. order:0, mode:0x50 

a bunch of Stack and Trace info stuff <........> 

 

or 

 

ifconfig: page allocation failure. order:0, mode:0xd0 

a bunch of Stack and Trace info stuff <.....> 

ifconfig: program too big 

 

Also, I have modified my altera.c file to get me started. I used the "Maps for Altera Nios Development kit" under Mapping drivers, then modified the altera.c file. Can I use the "CFI Flash device in physical memory map," then generate a map file for my flash? 

 

Here is what I&#39;m getting now when I launch the terminal window. 

 

--Doug 

 

 

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

 

setup_arch: No persistant network settings signature at 00FF0000 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 ro 

PID hash table entries: 32 (order: 5, 512 bytes) 

Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) 

Inode-cache hash table entries: 512 (order: -1, 2048 bytes) 

Memory available: 2308k/4096k RAM, 0k/0k ROM (1399k kernel code, 310k data) 

Mount-cache hash table entries: 512 (order: 0, 4096 bytes) 

NET: Registered protocol family 16 

Serial: JTAG UART driver $Revision: 1.3 $ 

ttyJ0 at MMIO 0x80000840 (irq = 3) is a jtag_uart 

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize 

smc_probe: 50000 Khz Nios 

SMSC LAN91C111 Driver (v2.1), (Linux Kernel 2.6) 

eth0: SMC91C11xFD(rev:1) at 0x80010300 IRQ:9 MEMSIZE:8192b NOWAIT:0 ADDR: 00:07:ed:00:00:00  

smc_probe: 50000 Khz Nios 

Using anticipatory io scheduler 

Custom board flash (AMD): Found 1 x8 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

Custom board flash (AMD): CFI does not contain boot bank location. Assuming top. 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 2 MTD partitions on "Custom board flash (AMD)": 

0x00200000-0x00600000 : "romfs/jffs2" 

0x00000000-0x00200000 : "loader/kernel" 

NET: Registered protocol family 2 

IP: routing cache hash table of 512 buckets, 4Kbytes 

TCP: Hash tables configured (established 512 bind 1024) 

NET: Registered protocol family 1 

NET: Registered protocol family 17 

VFS: Mounted root (romfs filesystem) readonly. 

Freeing unused kernel memory: 48k freed (0x58e000 - 0x599000) 

expand: from=/ramfs.img to=/dev/ram0 

oom-killer: gfp_mask=0x1d2 

DMA per-cpu: empty 

Normal per-cpu: 

cpu 0 hot: low 2, high 6, batch 1 

cpu 0 cold: low 0, high 2, batch 1 

HighMem per-cpu: empty 

 

Free pages: 128kB (0kB HighMem) 

Active:64 inactive:8 dirty:0 writeback:0 unstable:0 free:32 slab:452 mapped:0 pagetables:0 

DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

Normal free:128kB min:128kB low:256kB high:384kB active:256kB inactive:32kB present:4096kB 

protections[]: 0 0 0 

HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

DMA: empty 

Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 128kB 

HighMem: empty 

Out of Memory: Killed process 1 (init). 

oom-killer: gfp_mask=0x1d2 

DMA per-cpu: empty 

Normal per-cpu: 

cpu 0 hot: low 2, high 6, batch 1 

cpu 0 cold: low 0, high 2, batch 1 

HighMem per-cpu: empty 

 

Free pages: 128kB (0kB HighMem) 

Active:70 inactive:0 dirty:0 writeback:0 unstable:0 free:32 slab:449 mapped:0 pagetables:0 

DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

Normal free:128kB min:128kB low:256kB high:384kB active:280kB inactive:0kB present:4096kB 

protections[]: 0 0 0 

HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

DMA: empty 

Normal: 0*4kB 2*8kB 1*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 128kB 

HighMem: empty 

Out of Memory: Killed process 11 (sh). 

Out of Memory: Killed process 14 (sh). 

mount: page allocation failure. order:6, mode:0xd0 

Stack from 00743d58:<0> 

<0> 00000006<0> 0042c21c<0> 005b6d60<0> 00000010<0> 00000000<0> 00000001<0> 000000d0<0> 000000d0<0> 

<0> 0000000d<0> 005acf6c<0> 005acf60<0> 005c1120<0> 005acf60<0> 005d9400<0> 0042c24c<0> 00430084<0> 

<0> 00000000<0> 0043095c<0> 00000027<0> 0001abf0<0> 00004094<0> 0055fd94<0> 005bc260<0> 00000001<0> 

<0> 000279c4<0> 00000001<0> 004305ac<0> 00000000<0> 00436390<0> 00000000<0> 00000000<0> 00000000<0> 

<0> 00000080<0> 005b6d00<0> 00000001<0> 00023100<0> 00005170<0> 00000004<0> 005ffa00<0> ffffe000<0> 

<0> 0044877c<0> 00445d58<0> 6e756f6d<0> 00000074<0> 00000010<0> 00000020<0> 00000000<0> 00000000<0> 

Call Trace:<0> 

<0> [<00466958>]<0> [<0042be30>]<0> [<004466fc>]<0> [<00446954>]<0> 

<0> [<004044f0>]<0> [<00403098>]<0> [<00402b38>]<0> 

Allocation of length 162244 from process 14 failed 

DMA per-cpu: empty 

Normal per-cpu: 

cpu 0 hot: low 2, high 6, batch 1 

cpu 0 cold: low 0, high 2, batch 1 

HighMem per-cpu: empty 

 

Free pages: 96kB (0kB HighMem) 

Active:70 inactive:16 dirty:0 writeback:0 unstable:0 free:24 slab:434 mapped:0 pagetables:0 

DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

Normal free:96kB min:128kB low:256kB high:384kB active:280kB inactive:64kB present:4096kB 

protections[]: 0 0 0 

HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB 

protections[]: 0 0 0 

DMA: empty 

Normal: 0*4kB 0*8kB 0*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 96kB 

HighMem: empty 

Unable to allocate RAM for process text/data, errno 12 

 

 

 

nios2-terminal:
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
566 Views

Your problem is there is not enough available paged memory (only 128KB) to run many programs. You are going to have to try and reduce your kernel footprint. Start by disabling the following kernel config options 

 

General Setup > Configure standard kernel features (for small systems) > Load all symbols for debugging/kksymoops 

Loadable module support > Enable loadable module support 

Device Drivers > Character Devices > Unix98 PTY support 

Device Drivers > Charater Devices > Legacy (BSD) PTY support 

File system > DOS/FAT/NT > VFAT (Windows-95) fs support 

File system > Network filesystems > NFS filesystem support 

Kernel Hacking > Full Symbolic/Source Debugging support 

 

If that does not give you enough space you could look at reducing the size of the ramfs.img size to create a smaller ramdisk.
0 Kudos
Altera_Forum
Honored Contributor II
566 Views

I&#39;ve been away from my desk for most of the day, so I just now got the chance to try your suggestions. That did the trick, I&#39;m able to get to the login prompt without the memory overload errors. This gives me something for now, thanks for the help. 

 

Doug
0 Kudos
Reply