Skip to content

Commit

Permalink
uffd: add config to disable fetch memory data in the background
Browse files Browse the repository at this point in the history
Signed-off-by: Liu Hua <[email protected]>
  • Loading branch information
Liu Hua committed Oct 15, 2024
1 parent 50d1265 commit d28996b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion criu/cr-restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
#endif

struct pstree_item *current;
static bool disable_background_lazy_page_fetch;

static int restore_task_with_children(void *);
static int sigreturn_restore(pid_t pid, struct task_restore_args *ta, unsigned long alen, CoreEntry *core);
Expand Down Expand Up @@ -2213,7 +2214,7 @@ static int restore_root_task(struct pstree_item *init)
goto out_kill_network_unlocked;
}

if (lazy_pages_finish_restore())
if (!disable_background_lazy_page_fetch && lazy_pages_finish_restore())
goto out_kill_network_unlocked;

__restore_switch_stage(CR_STATE_COMPLETE);
Expand Down Expand Up @@ -3499,3 +3500,8 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
exit(1);
return -1;
}

static void __attribute__((constructor)) pagemap_cache_init(void)
{
disable_background_lazy_page_fetch = (getenv("CRIU_DISABLE_BACKGROUND_LAZY_PAGE_FETCH") != NULL);

Check warning on line 3506 in criu/cr-restore.c

View workflow job for this annotation

GitHub Actions / build

}

0 comments on commit d28996b

Please sign in to comment.