[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    Re: [uClinux-dev] Kernel RAM Configuration Question
From:       paul-rimmer () ronin-tech ! com
Date:       2005-02-28 22:05:25
Message-ID: 38114.216.123.208.8.1109628325.squirrel () ronin-tech ! com
[Download RAW message or body]

Eureka!  The old "didn't know to edit the page_alloc.h for custom target
problem".

===============================================================

Memory available: 28604k/32768k RAM, 0k/0k ROM (962k kernel code, 236k data)

# cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  29323264  1671168 27652096        0    53248    86016
Swap:        0        0        0
MemTotal:        28636 kB
MemFree:         27004 kB
MemShared:           0 kB
Buffers:            52 kB
Cached:             84 kB
SwapCached:          0 kB
Active:             40 kB
Inactive:           96 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        28636 kB
LowFree:         27004 kB
SwapTotal:           0 kB
SwapFree:            0 kB

===============================================================

That was really buggin me. :-)

Cheers,
Paul

> Hi all,
>
> Playing around with uClinux on a 5272 based platform with 32MB of RAM/8MB
> of Flash.  After bootup, it appears that user applications are only left
> with 4288kB out of the original 32 MB.  Basically I'm trying to account
> for where the other ~28MB was allocated.
>
> # cat /proc/meminfo
>         total:    used:    free:  shared: buffers:  cached:
> Mem:  16678912 12288000  4390912        0    53248    86016
> Swap:        0        0        0
> MemTotal:        16288 kB
> MemFree:          4288 kB
> MemShared:           0 kB
> Buffers:            52 kB
> Cached:             84 kB
> SwapCached:          0 kB
> Active:             40 kB
> Inactive:           96 kB
> HighTotal:           0 kB
> HighFree:            0 kB
> LowTotal:        16288 kB
> LowFree:          4288 kB
> SwapTotal:           0 kB
> SwapFree:            0 kB
>
> I've added some printf's to some of the code so you may see some non-stock
> messages.  At startup, the following info is logged:
>
> ================================================================
>
> uClinux/COLDFIRE(m5272)
> COLDFIRE port done by Greg Ungerer, gerg@snapgear.com
> Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
> before free_area_init
> free_area_init -> start_mem is 0x403ae000
> virtual_end is 0x42000000
> Page Size is 4096
> zone 0 size is 0
> zone 1 size is 270336
> zone 2 size is 0
> zone start addr: 0
>  totalpages in 3 zone is 270336
> On node 0 totalpages: 270336
> zone(0): 0 pages.
> zone(1): 270336 pages.
> zone(2): 0 pages.
> Kernel command line: rootfstype=romfs CONSOLE=/dev/ttyS1
> Calibrating delay loop... 39.73 BogoMIPS
> Mem_init: start=403ae000, end=42000000
> Ram Start: 40000000 End: 42000000
> Text (Code) Start: 40020000 End: 401109f8
> Data (bss/data) Start: 401109f8 End: 4014bd70
> CONFIG_UCLINUX is true
> Memory available: 16256k/32768k RAM, 0k/0k ROM (962k kernel code, 236k
> data)
> kmem_create: Forcing size word alignment - vm_area_struct
> kmem_create: Forcing size word alignment - mm_struct
> kmem_create: Forcing size word alignment - filp
> Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
> Inode cache hash table entries: 131072 (order: 8, 1048576 bytes)
> kmem_create: Forcing size word alignment - inode_cache
> Mount-cache hash table entries: 32768 (order: 6, 262144 bytes)
> kmem_create: Forcing size word alignment - bdev_cache
> kmem_create: Forcing size word alignment - cdev_cache
> kmem_create: Forcing size word alignment - kiobuf
> Buffer-cache hash table entries: 65536 (order: 6, 262144 bytes)
> Page-cache hash table entries: 524288 (order: 9, 2097152 bytes)
>
> <SNIP>
>
> Blkmem copyright 1998,1999 D. Jeff Dionne
> Blkmem copyright 1998 Kenneth Albanowski
> Blkmem 1 disk images:
> 0: 4014BD70-403AD16F [VIRTUAL 4014BD70-403AD16F] (RO)
> RAMDISK driver initialized: 16 RAM disks of 2096K size 1024 blocksize
>
> <SNIP>
>
> VFS: Mounted root (romfs filesystem) readonly.
> Freeing unused kernel memory: 32k freed (0x40130000 - 0x40137000)
> Found JFFS2 Config filesystem on /dev/mtdblk2.
> JFFS2 version of Config is OK
> Mounting JFFS2 Config Filesystem on /etc/config
>
> ================================================================
>
> The Romfs lives in an mtd partition that I've set to be "Kernel/root
> filesystem(7360KiB)" in size.  At startup, I believe everything is copied
> to and then run out of RAM.  Our kernel binary is 1147664 bytes while our
> romfs image is  2495488 bytes.
>
> Some questions I have:
>
> 1) If PAGE_SIZE is 4096 bytes, how can the kernel allocate 270336 pages if
> I only have 32MB RAM?  It doesn't appear to add up.  This occurs if I use
> the basic or non-power of 2 allocator.
>
> 2) "Memory available: 16256k/32768k RAM, 0k/0k ROM (962k kernel code, 236k
> data)".  This appears to indicate that I only have 16256k to play with
> once the kernel has used what it needs. /proc/meminfo indicates that after
> 32k was freed ("Freeing unused kernel memory: 32k freed (0x40130000 -
> 0x40137000)") I have a total of 16288k to play with.  Where did the 32768
> - 16256 = 16512kB go?  Even with the kernel and apps being copied into RAM
> that seems excessive.  Any tips on how I could account for where the
> 16512kB went?
>
> Cheers,
> Paul
>
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev@uClinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev@uclinux.org
>


_______________________________________________
uClinux-dev mailing list
uClinux-dev@uClinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic