Skip to content

Commit

Permalink
mem: optimize debug logging enqueued pages
Browse files Browse the repository at this point in the history
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] 91388fc

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Apr 16, 2024
1 parent 1a4c103 commit 6e9bc91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion criu/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6e9bc91

Please sign in to comment.