updates to design

This commit is contained in:
asafpamzn 2025-11-16 12:26:44 +02:00
parent d39e2b5ff2
commit 1cc059abd2
No known key found for this signature in database
10 changed files with 3 additions and 67 deletions

View file

@ -1,7 +1,3 @@
[codespell]
<<<<<<< HEAD
skip = ./.git,./test/pki,./tags
=======
skip = ./.git,./test/pki,./tags,./plugins/amdgpu/amdgpu_drm.h,./plugins/amdgpu/drm.h,./plugins/amdgpu/drm_mode.h
>>>>>>> upstream/criu-dev
ignore-words-list = creat,fpr,fle,ue,bord,parms,nd,te,testng,inh,wronly,renderd,bui,clen,sems

View file

@ -794,12 +794,8 @@ class coredump_generator:
off = 0 # in pages
for m in pagemap[1:]:
found = False
<<<<<<< HEAD
num_pages = m.get("nr_pages", m.compat_nr_pages)
=======
num_pages = m.get("nr_pages", m["compat_nr_pages"])
>>>>>>> upstream/criu-dev
for i in range(num_pages):
if m["vaddr"] + i * PAGESIZE == page_no * PAGESIZE:
found = True

View file

@ -705,10 +705,7 @@ int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd,
BOOL_OPT("unprivileged", &opts.unprivileged),
BOOL_OPT("ghost-fiemap", &opts.ghost_fiemap),
BOOL_OPT(OPT_ALLOW_UPROBES, &opts.allow_uprobes),
<<<<<<< HEAD
{ "cow-dump", no_argument, 0, 1105 },
=======
>>>>>>> upstream/criu-dev
{},
};

View file

@ -808,8 +808,6 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (setup_logging_from_req(req, output_changed_by_rpc_conf))
goto err;
<<<<<<< HEAD
=======
if (check_caps())
goto err;
@ -820,7 +818,6 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_pidfd_store_sk && init_pidfd_store_sk(ids.pid, req->pidfd_store_sk))
goto err;
>>>>>>> upstream/criu-dev
if (req->mntns_compat_mode)
opts.mntns_compat_mode = true;

View file

@ -62,13 +62,10 @@ enum {
CR_PLUGIN_HOOK__POST_FORKING = 12,
<<<<<<< HEAD
=======
CR_PLUGIN_HOOK__RESTORE_INIT = 13,
CR_PLUGIN_HOOK__DUMP_DEVICES_LATE = 14,
>>>>>>> upstream/criu-dev
CR_PLUGIN_HOOK__MAX
};
@ -88,11 +85,8 @@ DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__RESUME_DEVICES_LATE, int pid);
DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__PAUSE_DEVICES, int pid);
DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__CHECKPOINT_DEVICES, int pid);
DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__POST_FORKING, void);
<<<<<<< HEAD
=======
DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__RESTORE_INIT, void);
DECLARE_PLUGIN_HOOK_ARGS(CR_PLUGIN_HOOK__DUMP_DEVICES_LATE, int id);
>>>>>>> upstream/criu-dev
enum {
CR_PLUGIN_STAGE__DUMP,

View file

@ -1218,23 +1218,17 @@ static int page_server_get_pages(int sk, struct page_server_iov *pi)
* on 32-bit platforms (e.g. armv7). */
nr_pages = pi->nr_pages;
ret = page_pipe_read(pp, &pipe_read_dest, pi->vaddr, &nr_pages, PPB_LAZY);
<<<<<<< HEAD
if (ret) {
ps_stats.get_errors++;
=======
if (ret)
>>>>>>> upstream/criu-dev
return ret;
return ret;
}
<<<<<<< HEAD
=======
/*
* The pi is reused for send_psi here, so .nr_pages, .vaddr and
* .dst_id all remain intact.
*/
>>>>>>> upstream/criu-dev
pi->nr_pages = nr_pages;
if (pi->nr_pages == 0) {
pr_debug("no iovs found, zero pages\n");

View file

@ -60,11 +60,8 @@ static cr_plugin_desc_t *cr_gen_plugin_desc(void *h, char *path)
__assign_hook(PAUSE_DEVICES, "cr_plugin_pause_devices");
__assign_hook(CHECKPOINT_DEVICES, "cr_plugin_checkpoint_devices");
__assign_hook(POST_FORKING, "cr_plugin_post_forking");
<<<<<<< HEAD
=======
__assign_hook(RESTORE_INIT, "cr_plugin_restore_init");
__assign_hook(DUMP_DEVICES_LATE, "cr_plugin_dump_devices_late");
>>>>>>> upstream/criu-dev
#undef __assign_hook
@ -262,10 +259,6 @@ int cr_plugin_init(int stage)
goto err;
}
<<<<<<< HEAD
if (stage == CR_PLUGIN_STAGE__RESTORE && check_inventory_plugins())
goto err;
=======
if (stage == CR_PLUGIN_STAGE__RESTORE) {
int ret;
@ -276,7 +269,6 @@ int cr_plugin_init(int stage)
if (ret < 0 && ret != -ENOTSUP)
goto err;
}
>>>>>>> upstream/criu-dev
exit_code = 0;
err:

View file

@ -953,7 +953,6 @@ static int uffd_check_op_error(struct lazy_pages_info *lpi, const char *op, unsi
return 0;
}
<<<<<<< HEAD
static int xfer_pages(struct lazy_pages_info *lpi);
/*
* Aggressively refill pipeline to maximum capacity.
@ -974,8 +973,7 @@ static int refill_pipeline(struct lazy_pages_info *lpi)
return 0;
}
=======
>>>>>>> upstream/criu-dev
static int uffd_copy(struct lazy_pages_info *lpi, __u64 address, unsigned long *nr_pages)
{
struct uffdio_copy uffdio_copy;

View file

@ -27,11 +27,7 @@ endif
criu-amdgpu.pb-c.c: criu-amdgpu.proto
protoc --proto_path=. --c_out=. criu-amdgpu.proto
<<<<<<< HEAD
amdgpu_plugin.so: amdgpu_plugin.c amdgpu_plugin_drm.c amdgpu_plugin_topology.c amdgpu_plugin_util.c criu-amdgpu.pb-c.c amdgpu_socket_utils.c
=======
amdgpu_plugin.so: amdgpu_plugin.c amdgpu_plugin_drm.c amdgpu_plugin_dmabuf.c amdgpu_plugin_topology.c amdgpu_plugin_util.c criu-amdgpu.pb-c.c amdgpu_socket_utils.c
>>>>>>> upstream/criu-dev
$(CC) $(PLUGIN_CFLAGS) $(shell $(COMPEL) includes) $^ -o $@ $(PLUGIN_INCLUDE) $(PLUGIN_LDFLAGS) $(LIBDRM_INC)
amdgpu_plugin_clean:

View file

@ -33,11 +33,8 @@
#include "criu-log.h"
#include "files.h"
#include "pstree.h"
<<<<<<< HEAD
=======
#include "sockets.h"
#include "rst-malloc.h"
>>>>>>> upstream/criu-dev
#include "common/list.h"
#include "amdgpu_drm.h"
@ -71,8 +68,6 @@ bool plugin_added_to_inventory = false;
bool plugin_disabled = false;
<<<<<<< HEAD
=======
struct handle_id {
int handle;
int fdstore_id;
@ -86,7 +81,6 @@ struct shared_handle_ids *shared_memory = NULL;
static mutex_t *shared_memory_mutex;
int current_pid;
>>>>>>> upstream/criu-dev
/*
* In the case of a single process (common case), this optimization can effectively
* reduce the restore latency with parallel restore. In the case of multiple processes,
@ -1818,11 +1812,8 @@ int amdgpu_plugin_restore_file(int id, bool *retry_needed)
size_t img_size;
FILE *img_fp = NULL;
<<<<<<< HEAD
=======
*retry_needed = false;
>>>>>>> upstream/criu-dev
if (plugin_disabled)
return -ENOTSUP;
@ -2185,16 +2176,6 @@ int amdgpu_plugin_resume_devices_late(int target_pid)
CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__RESUME_DEVICES_LATE, amdgpu_plugin_resume_devices_late)
<<<<<<< HEAD
int sdma_copy_bo_helper(uint64_t size, int fd, FILE *storage_fp, void *buffer, size_t buffer_size,
amdgpu_device_handle h_dev, uint64_t max_copy_size, enum sdma_op_type type)
{
return sdma_copy_bo((struct kfd_criu_bo_bucket){ 0, size, 0, 0, 0, 0, fd, 0 }, storage_fp, buffer,
buffer_size, h_dev, max_copy_size, SDMA_OP_VRAM_WRITE);
}
=======
>>>>>>> upstream/criu-dev
int init_dev(int dev_minor, amdgpu_device_handle *h_dev, uint64_t *max_copy_size)
{
int ret = 0;
@ -2303,15 +2284,10 @@ void *parallel_restore_bo_contents(void *_thread_data)
entry = &restore_cmd->entries[i];
fseek(bo_contents_fp, entry->read_offset + offset, SEEK_SET);
<<<<<<< HEAD
ret = sdma_copy_bo_helper(entry->size, restore_cmd->fds_write[entry->write_id], bo_contents_fp, buffer,
buffer_size, h_dev, max_copy_size, SDMA_OP_VRAM_WRITE);
=======
ret = sdma_copy_bo(restore_cmd->fds_write[entry->write_id], entry->size, bo_contents_fp,
buffer, buffer_size, h_dev,
max_copy_size, SDMA_OP_VRAM_WRITE, false);
>>>>>>> upstream/criu-dev
if (ret) {
pr_err("Failed to fill the BO using sDMA: bo_buckets[%d]\n", i);
goto err_sdma;