RE: Memory usage analysis and optimization

Jesse-SC Chou (周書正) <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
Hi, Adam,

Many thanks for your suggestion.
It works with shrinking KMEM_SIZE from 16MB to 1MB(JDB disabled).
By printing kernel memory usage by Kmem_alloc::debug_dump(), it seems only 758KB used in the following message.

"Used 758KB out of 1024KB of Kmem"

Now I can get a larger continuous memory area on my platform. Thanks again.

BRs,
Jesse
-----Original Message-----
From: l4-hackers [mailto:[email protected]] On Behalf Of Adam Lackorzynski
Sent: Monday, December 19, 2016 6:46 AM
To: [email protected]
Subject: Re: Memory usage analysis and optimization

Hi,

On Fri Dec 16, 2016 at 08:38:28 +0000, Jesse-SC Chou (©P®Ñ¥¿) wrote:
> I¡¦m analyzing the memory usage of Fiasco/L4Re/L4Linux.
> On my platform, there are 128MB physical memory.
> L4 bootstrap can detect it correctly.
> ==================================================
> L4 Bootstrapper
>   Build: #164 Îå 12ÔÂ  9 11:39:51 CST 2016, 4.8.4
>   Scanning up to 128 MB RAM, starting at offset 32MB
>   Memory size is 128MB (20000000 - 27ffffff)
>   RAM: 0000000020000000 - 0000000027ffffff: 131072kB
>   Total RAM: 128MB
> ==================================================
> 
> The memory regions after boot up and sigma0 loaded:
> ==================================================
> Regions of list 'regions'
>     [ 20000000,  200001c7] {      1c8} Root   mbi_rt
>     [ 20001000,  20001aff] {      b00} Kern   fiasco
>     [ 20002000,  20092fff] {    91000} Kern   fiasco
>     [ 200c0000,  200c9f43] {     9f44} Sigma0 sigma0
>     [ 200d0000,  200d6177] {     6178} Sigma0 sigma0
>     [ 20140000,  20168c27] {    28c28} Root   moe
>     [ 20170000,  2017b58b] {     b58c} Root   moe
>     [ 21000000,  2100e5e3] {     e5e4} Boot   bootstrap
>     [ 21100000,  21a2dfff] {   92e000} Root   Module
> 
> SIGMA0: Hello!
>   KIP @ 20002000
>   allocated 4KB for maintenance structures
> SIGMA0: Dump of all resource maps
> RAM:------------------------
> [4:20000000;20000fff]
> [0:20093000;200bffff]
> [0:200ca000;200cffff]
> [0:200d7000;2013ffff]
> [4:20140000;20168fff]
> [0:20169000;2016ffff]
> [4:20170000;2017bfff]
> [0:2017c000;210fffff]
> [4:21100000;21a2dfff]
> [0:21a2e000;26ffffff]
> ==================================================
> 
> The largest unused continuous memory region are at ¡§0x21a2e000 ~ 0x26ffffff¡¨, which is about 85MB.
> I would like to make continuous memory region larger and have the following ideas and questions:

Generally: yes, there are tuning possibilities, given that memory and program sizes are known.

> 1.      The memory used by bootstrap may be freed after the system bring up. If moving ¡§bootstrap¡¨ program to 0x26000000, the ¡§Module¡¨ programs can append to ¡§MOE¡¨ program. The ¡§Module¡¨ will be started ¡§0x207c0000¡¨ (aligned to page size 4KB). Thus, I can get larger continuous memory area that originally separated by ¡§bootstrap¡¨ program. Is this idea correct ?
> 
>     [ 20170000,  2017b58b] {     b58c} Root   moe
>     [ 21000000,  2100e5e3] {     e5e4} Boot   bootstrap
>     [ 21100000,  21a2dfff] {   92e000} Root   Module

Yes, should generally work I think.

> 2.      There are a reserved region ¡§0x27000000 ~ 0x27FFFFFF¡¨ not shown in boot log. When I traced into program, this region seems used by sigma0. What is this memory used for? I think 16MB is a very large chunk in current embedded system. Can we compute the amount this area really use and shrink to a smaller size?

That's the memory taken by Fiasco, see src/kern/arm/config-arm.cpp KMEMSIZE. Depending on your use case you can make this smaller.


Adam

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.