Forbid deletion of memory mappings

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Clemens Kolbitsch
Date: Thursday, August 30, 2007 - 9:44 am

Hi everyone!
I have a strange problem where I don't even know if there is a solution to it 
at the moment:

I'm working on a new way of doing memory-management and currently I allocate 
memory mappings (at non-fixed locations) in user-memory (i.e. < TASK_SIZE) in 
addition to the regular pages mapped for the apps (e.g. heap memory, etc.)

It all works perfectly well (creating & deleting the additional mappings), 
however, when the kernel feels like it needs to allocate a mapping in 
user-space it sometimes deletes my mapping and overwrites it with the new 
one, although there is plenty of free memory at some other location.

typically my mappings are (automatically chosen) located somewhere around 
0xb7xxxxxx although there's plenty free space around 0xayyyyyyy. (i know that 
this is a bad location because of stack, etc.) but i need the kernel to 
choose a good location for me...

is there a way to make sure my mappings are not removed from memory?? or is 
there a location where i can put my mappings that they will not be removed 
(i.e. by using MAP_FIXED)?
Note that i need a big amount of memory so the range will have to be fairly 
big (to be precise: i need a lot of 0x1000byte mappings - they are always 
page-sized, not bigger, not smaller, but A LOT of them :-/ )

hope someone can help me with this!
thanks & greets,
  Clemens
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Forbid deletion of memory mappings, Clemens Kolbitsch, (Thu Aug 30, 9:44 am)
Re: Forbid deletion of memory mappings, Jiri Kosina, (Thu Aug 30, 10:07 am)
Re: Forbid deletion of memory mappings, Clemens Kolbitsch, (Thu Aug 30, 10:09 am)
Re: Forbid deletion of memory mappings, Clemens Kolbitsch, (Thu Aug 30, 2:32 pm)
Re: Forbid deletion of memory mappings, Jiri Kosina, (Thu Aug 30, 2:34 pm)
Re: Forbid deletion of memory mappings, Clemens Kolbitsch, (Thu Aug 30, 2:41 pm)
Re: Forbid deletion of memory mappings, Valdis.Kletnieks, (Thu Aug 30, 2:50 pm)
Re: Forbid deletion of memory mappings, Jiri Kosina, (Thu Aug 30, 2:55 pm)
Re: Forbid deletion of memory mappings, Clemens Kolbitsch, (Thu Aug 30, 3:05 pm)
Re: Forbid deletion of memory mappings, Helge Hafting, (Tue Sep 4, 3:17 am)
Re: Forbid deletion of memory mappings, Clemens Kolbitsch, (Tue Sep 4, 3:29 am)
Re: Forbid deletion of memory mappings, linux-os (Dick Johnson), (Tue Sep 4, 7:53 am)