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

List:       busybox
Subject:    [BusyBox] Memory fragmention with insmod and uClinux
From:       Fabrice Gautier <Fabrice_Gautier () sdesigns ! com>
Date:       2002-10-31 19:05:06
[Download RAW message or body]

Hi,

I'm using the insmod from busybox to load modules on uClinux.
The problem is that once i've include a module the memory is fragmented.

I'm using the "non power of 2" allocator in uClinux, and here are the memory
maps as shown by cat /proc/mem_map


before loading the module (just sash running):

0x01000000: RRRRRRRR---------RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x01040000: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x01080000: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x010c0000: RRRRRRRRRRRRRRRRRRRRRRR[===============]------------------------
0x01100000: ----------------------------------------------------------------
0x01140000: ----------------------------------------------------------------
0x01180000: ----------------------------------------------------------------
0x011c0000: ----------------------------------------------------------------
0x01200000: ----------------------------------------------------------------
0x01240000: ----------------------------------------------------------------
0x01280000: ----------------------------------------------------------------
0x012c0000: ----------------------------------------------------------------
0x01300000: ----------------------------------------------------------------
0x01340000: ----------------------------------------------------------------
0x01380000: ----------------------------------------------------------------
0x013c0000: ----------------------------------------------------------------
0x01400000: ----------------------------------------------------------------
0x01440000: ----------------------------------------------------------------
0x01480000: ----------------------------------------------------------------
0x014c0000: ----------------------------------------------------------------
0x01500000: ----------------------------------------------------------------
0x01540000: ----------------------------------------------------------------
0x01580000: ----------------------------------------------------------------
0x015c0000: ----------------------------------------------------------------
0x01600000: ----------------------sss111----[]--------------ss---------s----
0x01640000: s1ss-s----s-----[][][][]ssR1ssss[][]sssssssssssss11ssssss1[]ss[]

After loading the module:

0x01000000: RRRRRRRR---------RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x01040000: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x01080000: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
0x010c0000: RRRRRRRRRRRRRRRRRRRRRRR[===============]------------------------
0x01100000: ----------------------------------------------------------------
0x01140000: -----------[====================================================
0x01180000: ================]-----------------------------------------------
0x011c0000: -----------------------[=======================]----------------
0x01200000: ----------------------------------------------------------------
0x01240000: ----------------------------------------------------------------
0x01280000: ----------------------------------------------------------------
0x012c0000: ----------------------------------------------------------------
0x01300000: ----------------------------------------------------------------
0x01340000: ----------------------------------------------------------------
0x01380000: ----------------------------------------------------------------
0x013c0000: ----------------------------------------------------------------
0x01400000: ----------------------------------------------------------------
0x01440000: ----------------------------------------------------------------
0x01480000: ----------------------------------------------------------------
0x014c0000: ----------------------------------------------------------------
0x01500000: ----------------------------------------------------------------
0x01540000: ----------------------------------------------------------------
0x01580000: ----------------------------------------------------------------
0x015c0000: -----------------------------------------------------------s----
0x01600000: ----------------------sss111----[]-------------ssssssss-s-ss-s--
0x01640000: s1ss-sss-ss-ssss[][][][]ssR1ssss[][]sssssssssssss11ssssss1[]ss[]


The first big chunk of memory allocated match the size of the module (code
+data) and the smaller chunk is the allocated by a vmalloc in the
init_module.

Does someone has a suggestion to avoid this fragmentation ? I already tought
of doing a static allocation instead of the vmalloc to avoid having two
chunk. 

Thanks

-- 
Fabrice Gautier, 
Fabrice_Gautier@sdesigns.com

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

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