CRIU supports checkpointing and restoring kernel-level Asynchronous I/O (AIO) contexts, which are managed via the io_setup, io_submit, io_getevents, and io_destroy system calls.
To successfully checkpoint and restore an AIO context, CRIU manages three primary components:
[aio] label in /proc/pid/maps or by detecting the specific VMA attributes.The restoration of an AIO ring is complex because the kernel’s AIO context ID (the aio_context_t value) is an internal pointer that cannot be arbitrarily assigned by userspace. CRIU uses the following strategy to restore it:
io_setup to create a fresh AIO ring with the original number of requested events.tail pointer to the original position, CRIU submits dummy I/O requests (typically writes to /dev/null). Since these operations are synchronous for the device, the kernel advances the tail as each request completes.head pointer in the ring header to match the state at the time of the dump.io_events data (the completed but unread events) is copied from the dump image into the new ring buffer.mremap to move the new ring buffer to its original virtual address, ensuring the application can continue using its existing AIO context ID.Currently, in-flight events (I/O requests that have been submitted but not yet completed at the time of the dump) are not supported.