pagemap-cache: Introduce engine

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 interface is:
 - pmc_init/pmc_fini for cache initialization and freeing
 - pmc_get_map to retrieve specific PMEs array for VMA area

v2:
 - Move internal constants to pagemap-cache.c
 - Make PAGEMAP_LEN to accept virtual address/size
 - Don't adjust low bound in caching mode to save a couple of code bytes

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mem: Use pagemap cache

This improve speed if we're dumping a big set of small vmas.

CentOS-6 container
------------------

Without cache

dump: {
	freezing_time: 1705
	frozen_time: 44885
	memdump_time: 9064
	memwrite_time: 15846
	pages_scanned: 246979
	pages_skipped_parent: 0
	pages_written: 2831
	irmap_resolve: 0
}

With cache

dump: {
	freezing_time: 898
	frozen_time: 40859
	memdump_time: 7254
	memwrite_time: 16375
	pages_scanned: 246979
	pages_skipped_parent: 0
	pages_written: 2831
	irmap_resolve: 0
}

1024 VMA, 40K each
------------------
Without cache

dump: {
	freezing_time: 170
	frozen_time: 30372
	memdump_time: 3895
	memwrite_time: 691
	pages_scanned: 13487
	pages_skipped_parent: 0
	pages_written: 61
	irmap_resolve: 0
}

With cache

dump: {
	freezing_time: 231
	frozen_time: 27646
	memdump_time: 768
	memwrite_time: 798
	pages_scanned: 13487
	pages_skipped_parent: 0
	pages_written: 61
	irmap_resolve: 0
}

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>