[CRIU] [PATCH 0/5] lazy-pages: fix pre- and post-copy combination.

Mike Rapoport rppt at linux.vnet.ibm.com
Wed Jun 21 09:33:21 MSK 2017


Hi,

These patches fix the pre- and post-copy combination when khugepaged is
enabled [1].

When we combine pre-dump with lazy pages, we populate a part of a memory region
with data that was saved during the pre-dump. Afterwards, the region is
registered with userfaultfd and we expect to get page faults for the parts of
the region that were not yet populated. However, khugepaged collapses the pages
and the page faults we would expect do not occur.
    
To mitigate this problem we temporarily disable THP for the restored process,
up to the point when we register all the memory regions with userfaultfd.
    
Note, that currently disabling THP has a side effect that all VMAs of the
restored process will have VM_NOHUGEPAGE flag set. This will be resolved
when the appropriate patch [2] will be merged into the kernel.

[1] https://lists.openvz.org/pipermail/criu/2017-May/037728.html
[2] http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/commit/kernel/sys.c?id=252662e4127f52022d675081762e7882ebd9d496

Mike Rapoport (5):
  mem: kill trailing whitespace
  proc_parse: make smaps parsing helpers globally available
  kerndat: add test for availability of PR_SET_THP_DISABLE prctl
  lazy-pages: fix memory corruption when combining pre-dump with lazy pages
  test: add test that verifies proper intraction between lazy-pages and THP

 criu/cr-restore.c               |  3 ++
 criu/include/kerndat.h          |  1 +
 criu/include/pagemap.h          |  5 +++
 criu/include/prctl.h            |  8 +++++
 criu/include/proc_parse.h       |  3 ++
 criu/include/restorer.h         |  1 +
 criu/include/rst_info.h         |  2 ++
 criu/kerndat.c                  | 74 ++++++++++++++++++++++++++++++++++++++++
 criu/mem.c                      | 39 ++++++++++++++++++---
 criu/pie/restorer.c             |  8 +++++
 criu/proc_parse.c               | 75 ++++++++++++++++++++++++-----------------
 test/zdtm/transition/Makefile   |  1 +
 test/zdtm/transition/lazy-thp.c | 61 +++++++++++++++++++++++++++++++++
 13 files changed, 247 insertions(+), 34 deletions(-)
 create mode 100644 test/zdtm/transition/lazy-thp.c

-- 
2.7.4



More information about the CRIU mailing list