[CRIU] [PATCHv0 3/8] proc_parse: increase longest in vma list when vma is for anon shared mem

Eugene Batalov eabatalov89 at gmail.com
Sun Dec 6 05:15:19 PST 2015


From: Fyodor <bocharovfedor at gmail.com>

If we want to use pagemap cache to obtain info about anon shared mem pages
dirtiness we should choose longest from private and shared vmas and then
create cache of this size. To simplify code we can do that while parsing
proc/smaps.

Signed-off-by: Fyodor Bocharov <fbocharov at yandex.ru>
Signed-off-by: Eugene Batalov <eabatalov89 at gmail.com>
---
 proc_parse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/proc_parse.c b/proc_parse.c
index c479b0f..45e7c88 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -489,7 +489,8 @@ static int vma_list_add(struct vma_area *vma_area,
 
 	list_add_tail(&vma_area->list, &vma_area_list->h);
 	vma_area_list->nr++;
-	if (vma_area_is_private(vma_area, kdat.task_size)) {
+	if (vma_area_is_private(vma_area, kdat.task_size) ||
+			vma_area_is(vma_area, VMA_ANON_SHARED)) {
 		unsigned long pages;
 
 		pages = vma_area_len(vma_area) / PAGE_SIZE;
-- 
1.9.1



More information about the CRIU mailing list