[CRIU] [PATCH 1/2] pagemap: Introduce pagemap cache

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 11 11:08:43 PST 2014


Pavel reported that in case if there a big number
of small vmas present in the dumpee we're reading
/proc/pid/pagemap too frequently.

To speedup this procedue we inroduce pagemap cache.
The idea behind is simple

 - cache can carry PMEs which cover up to 2M of physical memory
   at least (or if longest VMA area is bigger than 2M, then we
   take its size for cache)
 - when it is asked to fetch PME from the cache and cache miss
   found, we walk over all near laying VMAs and pre-read their
   PMEs

The interface is:
 - pmc_init/pmc_fini for cache initialization and freeing
 - pmc_get_pfn_index to retrieve specific PME from cache

Reported-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile.crtools  |   1 +
 include/pagemap.h |  33 ++++++++++++++
 pagemap.c         | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 160 insertions(+)
 create mode 100644 include/pagemap.h
 create mode 100644 pagemap.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pagemap-Introduce-pagemap-cache.patch
Type: text/x-patch
Size: 4740 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140211/aa74e801/attachment.bin>


More information about the CRIU mailing list