lkml.org 
[lkml]   [2009]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: vma_merge issue
On Wed, 12 Aug 2009, Hugh Dickins wrote:
>
> Don't use anonymous memory, have a 1GB sparse file to back this,
> and mmap it MAP_SHARED, then you won't get charged for RAM+swap.

A "refinement" to that suggestion is to put the file on tmpfs:
you will then get charged for RAM+swap as you use it, but you can
use madvise MADV_REMOVE to unmap pages, punching holes in the file,
freeing up those charges. A little baroque, but I think it does
amount to a way of doing exactly what you wanted in the first place.

(Note: we do insist on PROT_WRITE access at the time of MADV_REMOVE:
I've even a feeling it was me who insisted on that.)

Hugh


\
 
 \ /
  Last update: 2009-08-12 22:57    [W:0.063 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site