[Gllug] Pages marked as present but not mapped

Nix nix at esperi.org.uk
Tue Aug 30 23:48:42 UTC 2011


On 30 Aug 2011, Christian Smith said:

> What I suspect is happening is that you're reading entries for pages that
> are not present (else the present bit would be 1) but are not swapped.

Agreed. Some of this may be text pages which haven't been paged in: some
may be due to malloc() overcommitment.

> This will be mmap'ed pages that have never been referenced. mmap'ed
> pages are never "swapped", they are written to their underlying file
> if dirty.

Only pages mmap()ed with PROT_WRITE and MAP_SHARED are ever written to
their underlying file. Pages mapped with PROT_WRITE and MAP_PRIVATE
*can* be swapped out.

>           Only anonymouse and private pages are swapped to the swap files.

Those pages are still mmap()ed.

> Unreferenced mmap pages simply use the virtual memory map information
> to locate their data from the file, so don't need the swap information.

There need be no data in the case of overcommitted anonymous mmap()s.

-- 
NULL && (void)
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list