mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
lazy-pages: use -PID instead of -1 for zombie processes
This gives somewhat saner debug messages Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
d66d5cdde8
commit
8cf8ddfb33
@@ -942,7 +942,7 @@ static int restore_one_zombie(CoreEntry *core)
|
|||||||
if (inherit_fd_fini() < 0)
|
if (inherit_fd_fini() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (lazy_pages_setup_zombie())
|
if (lazy_pages_setup_zombie(current->pid.virt))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
prctl(PR_SET_NAME, (long)(void *)core->tc->comm, 0, 0, 0);
|
prctl(PR_SET_NAME, (long)(void *)core->tc->comm, 0, 0, 0);
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
struct task_restore_args;
|
struct task_restore_args;
|
||||||
extern int setup_uffd(int pid, struct task_restore_args *task_args);
|
extern int setup_uffd(int pid, struct task_restore_args *task_args);
|
||||||
extern int lazy_pages_setup_zombie(void);
|
extern int lazy_pages_setup_zombie(int pid);
|
||||||
extern int prepare_lazy_pages_socket(void);
|
extern int prepare_lazy_pages_socket(void);
|
||||||
|
|
||||||
#endif /* __CR_UFFD_H_ */
|
#endif /* __CR_UFFD_H_ */
|
||||||
|
10
criu/uffd.c
10
criu/uffd.c
@@ -161,8 +161,8 @@ static int send_uffd(int sendfd, int pid)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for a zombie process pid will be -1 */
|
/* for a zombie process pid will be negative */
|
||||||
if (pid == -1) {
|
if (pid < 0) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -200,12 +200,12 @@ static int check_for_uffd()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lazy_pages_setup_zombie(void)
|
int lazy_pages_setup_zombie(int pid)
|
||||||
{
|
{
|
||||||
if (!opts.lazy_pages)
|
if (!opts.lazy_pages)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (send_uffd(0, -1))
|
if (send_uffd(0, -pid))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -482,7 +482,7 @@ static int ud_open(int client, struct lazy_pages_info **_lpi)
|
|||||||
}
|
}
|
||||||
pr_debug("received PID: %d\n", lpi->pid);
|
pr_debug("received PID: %d\n", lpi->pid);
|
||||||
|
|
||||||
if (lpi->pid == -1) {
|
if (lpi->pid < 0) {
|
||||||
lpi_fini(lpi);
|
lpi_fini(lpi);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user