Skip to content

checkpoint, restore: add lazy pages support - #2259

Open
kolyshkin wants to merge 3 commits into
containers:mainfrom
kolyshkin:cr-lazy-pages
Open

kolyshkin wants to merge 3 commits into
containers:mainfrom
kolyshkin:cr-lazy-pages

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Add lazy migration support, compatible with runc:

  • checkpoint --lazy-pages, to serve memory pages from the page server instead of saving them to the image;
  • checkpoint --page-server ADDRESS:PORT, to set the page server address and port;
  • checkpoint --status-fd FD, to get notified (by a zero byte written to FD) once the page server is ready;
  • restore --lazy-pages, to restore memory pages lazily from the criu lazy-pages daemon.

The public struct libcrun_checkpoint_restore_options_s is extended with the corresponding lazy_pages, page_server_address, page_server_port and status_fd fields. To keep a zero-initialized struct meaning "use the defaults", a status_fd of 0 means it is not set (same as e.g. btf_fd or attach_prog_fd in the kernel's bpf_attr); consequently, --status-fd 0 is rejected.

This requires checkpoint-restore/criu#3146, included in CRIU v4.3. For older criu versions, a clear error message is produced.

@packit-as-a-service

Copy link
Copy Markdown

Ephemeral COPR build failed. @containers/packit-build please check.

1 similar comment
@packit-as-a-service

Copy link
Copy Markdown

Ephemeral COPR build failed. @containers/packit-build please check.

@packit-as-a-service

Copy link
Copy Markdown

TMT tests failed. @containers/packit-build please check.

@kolyshkin

Copy link
Copy Markdown
Collaborator Author

Tested (with criu patched with checkpoint-restore/criu#3146 and crun patched with #2238) in kolyshkin#2:

  ok 42 checkpoint --lazy-pages and restore

@kolyshkin
kolyshkin force-pushed the cr-lazy-pages branch 5 times, most recently from 1013d25 to 80f051f Compare October 22, 2026 22:08
@kolyshkin
kolyshkin force-pushed the cr-lazy-pages branch 2 times, most recently from bc7ba78 to 7344d77 Compare October 26, 2026 20:26
@kolyshkin
kolyshkin marked this pull request as ready for review October 26, 2026 21:33
Add the following options, compatible with runc:
 - checkpoint --lazy-pages, to serve the memory pages from the page
   server instead of saving them to the image;
 - checkpoint --page-server ADDRESS:PORT, to set the page server
   address and port;
 - checkpoint --status-fd FD, to get notified (by a zero byte written
   to FD) once the page server is ready;
 - restore --lazy-pages, to restore the memory pages lazily from the
   criu lazy-pages daemon.

The public struct libcrun_checkpoint_restore_options_s is extended
with the corresponding lazy_pages, page_server_address,
page_server_port and status_fd fields. To keep a zero-initialized
struct meaning "use the defaults", a status_fd of 0 means it is not
set (and so --status-fd 0 is rejected).

This requires criu_set_lazy_pages() from libcriu, which is available
since CRIU 4.3. It is loaded optionally, and a clear error is returned
if it is not available.

Assisted-by: Claude Code (claude-opus-5-5)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
It mimics the runc "checkpoint --lazy-pages and restore" integration
test, and is skipped if either CRIU or libcriu lacks lazy pages support.

Assisted-by: Claude Code (claude-opus-5-5)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Now that crun supports checkpoint/restore with lazy pages, and the CRIU
PPA used in CI provides CRIU 4.3 (with criu_set_lazy_pages in libcriu),
remove the runc "checkpoint --lazy-pages and restore" test from the
skip list.

Assisted-by: Claude Code (claude-opus-5-5)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant