Re: [RFC v2] Support volatile range for anon vma

From: Arun Sharma
Date: Mon Nov 05 2012 - 21:38:23 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/