From 6e9bc9122b008bafebc773e9da8ceada594378c4 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 16 Apr 2024 12:40:20 +0100 Subject: [PATCH] mem: optimize debug logging enqueued pages During restore, CRIU prints "Enqueue page-read" messages for each page-read request [1]. However, this message does not provide useful information, increases performance overhead during restore and the size of log file. $ ./zdtm.py run -t zdtm/static/maps06 -f h -k always $ grep 'Enqueue' dump/zdtm/static/maps06/56/1/restore.log | wc -l 20494 This commit replaces these log messages with a single message that shows the number of enqueued page-read requests. $ grep 'enqueued' dump/zdtm/static/maps06/56/1/restore.log (00.061449) 56: nr_enqueued_pages: 20493 [1] https://github.com/checkpoint-restore/criu/commit/91388fc Signed-off-by: Radostin Stoyanov --- criu/mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/criu/mem.c b/criu/mem.c index 5f0d57eb66..67476c5c1a 100644 --- a/criu/mem.c +++ b/criu/mem.c @@ -1087,6 +1087,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr) unsigned int nr_shared = 0; unsigned int nr_dropped = 0; unsigned int nr_compared = 0; + unsigned int nr_enqueued = 0; unsigned int nr_lazy = 0; unsigned long va; @@ -1162,7 +1163,8 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr) len >>= PAGE_SHIFT; nr_restored += len; i += len - 1; - pr_debug("Enqueue page-read\n"); + + nr_enqueued++; continue; } @@ -1257,6 +1259,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr) cnt_add(CNT_PAGES_RESTORED, nr_restored); pr_info("nr_restored_pages: %d\n", nr_restored); + pr_info("nr_enqueued_pages: %d\n", nr_enqueued); pr_info("nr_shared_pages: %d\n", nr_shared); pr_info("nr_dropped_pages: %d\n", nr_dropped); pr_info("nr_lazy: %d\n", nr_lazy);