[CRIU] [PATCH v3 00/12] Implement anonymous shared memory deduplication

Eugene Batalov eabatalov89 at gmail.com
Sun Aug 7 06:11:04 PDT 2016


This patchset implements 3 types of shared memory deduplication:
1. Manual anonymous shared memory image deduplication on criu dedup command.
2. Anonymous shared memory pages autodedup on criu dump command.
Kernel provided SOFT_DIRTY bits + parent anon shmem image are used.
As with private anon mem this is enabled using --auto-dedup option.
3. Anonymous shared memory pages autodedup on criu restore command.
Each restored page is removed from anon shmem dump.
As with private anon mem this is enabled using --auto-dedup option.

This patchset heavily reuses existing page-read/xfer code
to implement the most of its new features.

=== v0 to v1 changes ===
- Collect separate longest vma sizes for private and shared
  anonymous memory.
- Reset process memory soft dirty bits 'symmetrically' in
  pre_dump_one_task() and dump_one_task().
- Remove 2nd PMC walk. Reuse process VMA loop in
  __parasite_dump_pages_seized().
- Use single page_in_parent() routine (don't use ots copy-paste).

=== v1 to v2 changes ===
- Don't dump not used anon shmem pages.
  Collect and analyze PME_SWAP and PME_PRESENT pagemap bits for this purpose.

=== v2 to v3 changes ===
- Add extensive ps tree with shmem test
- Rebase to current criu-dev branch.
  Change patch set behavior: use new PP_HOLE_ZERO, PP_HOLE_PARENT flags.
  Add zero page holes into dump as it is currently done in anon private mem.
  Previously zero page holes were not put into dump.

Eugene Batalov (3):
  mem: make page_is_zero externally linked
  shmem: add deduped anon shmem dumping to predump command
  test: add test for anon shmem dedup

Fyodor Bocharov (9):
  vma: rename longest to priv_longest
  proc_parse: collect longest shared vma size
  mem: reset SOFT_DIRTY bits after dumping of all vmas in the process
  shmem: pass anonymous shmem pagemap to add_shmem_area
  shmem: implement used and dirty pages tracking
  page-read/xfer: add ability to open image hierarchy for shmem
  mem: generalize page_in_parent function and make it extern
  shmem: implement anon shared memory dedup on dump
  shmem: implement manual anon shared memory dedup

 criu/cr-dedup.c                   |  23 +-
 criu/cr-dump.c                    |  17 +-
 criu/include/mem.h                |   6 +
 criu/include/pagemap.h            |   5 +-
 criu/include/shmem.h              |   3 +-
 criu/include/vma.h                |   6 +-
 criu/mem.c                        |  47 ++--
 criu/page-xfer.c                  |   5 +-
 criu/pagemap.c                    |  10 +-
 criu/proc_parse.c                 |  11 +-
 criu/shmem.c                      | 108 +++++++--
 test/jenkins/criu-dedup.sh        |   5 +-
 test/zdtm/transition/Makefile     |   1 +
 test/zdtm/transition/maps008.c    | 483 ++++++++++++++++++++++++++++++++++++++
 test/zdtm/transition/maps008.desc |   1 +
 15 files changed, 660 insertions(+), 71 deletions(-)
 create mode 100644 test/zdtm/transition/maps008.c
 create mode 100644 test/zdtm/transition/maps008.desc

-- 
1.9.1



More information about the CRIU mailing list