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

Andrei Vagin avagin at virtuozzo.com
Wed Jun 28 02:09:37 MSK 2017


Mike, pls don't send a whole series as a replay to a patch, patchwork
can't handle this case properly. Could you rebase and send this series
again.

Pavel, could you review it?

Thanks,
Andrei


On Wed, Jun 21, 2017 at 09:22:40PM +0300, Mike Rapoport wrote:
> 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.
> 
> v3:
> * drop unrelated patches
> * save current state of the THP disable prctl in mm*img
> * add comment as per Pavel's request
> 
> v2:
> * fix build on arm
> * massage lazy-thp test a bit
> 
> [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 (6):
>   mem: kill trailing whitespace
>   proc_parse: make smaps parsing helpers globally available
>   kerndat: add test for availability of PR_SET_THP_DISABLE prctl
>   mem: add dump state of THP_DISABLED 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-dump.c                  |  3 ++
>  criu/cr-restore.c               |  3 ++
>  criu/include/kerndat.h          |  1 +
>  criu/include/pagemap.h          |  5 +++
>  criu/include/parasite.h         |  1 +
>  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                      | 44 +++++++++++++++++++++---
>  criu/pie/parasite.c             |  1 +
>  criu/pie/restorer.c             |  8 +++++
>  criu/proc_parse.c               | 75 ++++++++++++++++++++++++-----------------
>  images/mm.proto                 |  1 +
>  test/zdtm/transition/Makefile   |  1 +
>  test/zdtm/transition/lazy-thp.c | 61 +++++++++++++++++++++++++++++++++
>  17 files changed, 258 insertions(+), 34 deletions(-)
>  create mode 100644 test/zdtm/transition/lazy-thp.c
> 
> -- 
> 2.7.4
> 


More information about the CRIU mailing list