Messages in this thread | | | Date | Mon, 5 Nov 2012 18:03:48 -0800 | From | Arun Sharma <> | Subject | Re: [RFC v2] Support volatile range for anon vma |
| |
On 11/5/12 5:49 PM, Minchan Kim wrote:
>> Also, memory allocators have a second motivation in using madvise: to >> create virtually contiguous regions of memory from a fragmented address >> space, without increasing the RSS. > > I don't get it. How do we create contiguos region by madvise? > Just out of curiosity. > Could you elaborate that use case? :)
By using a new anonymous map and faulting pages in.
The fragmented virtual memory is released via MADV_DONTNEED and if the malloc/free activity on the system is dominated by one process, chances are that the newly faulted in page is the one released by the same process :)
The net effect is that physical pages within a single address space are rearranged so larger allocations can be satisfied.
-Arun
| |