-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uffd: add config to disable fetch memory data in the background
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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 GitHub Actions / build
|
||
} |