criu

Pidfd Support

A pidfd is a file descriptor that refers to a specific process. Unlike traditional numeric PIDs, which can be reused by the kernel once a process terminates, a pidfd is a stable and race-free handle. It remains valid as long as the descriptor is open, even after the process it refers to has died. CRIU provides full support for checkpointing and restoring pidfds owned by applications.

How CRIU Handles Pidfds

CRIU treats pidfds as a specialized type of file descriptor. During a dump, it captures both the target of the pidfd and its configuration.

1. Checkpointing (Dumping)

When CRIU encounters a pidfd in a process’s file descriptor table:

2. Restoration

Restoring a pidfd involves recreating a handle that points to the equivalent process in the newly restored tree.

Kernel Evolution: From Anonymous Inodes to pidfs

The underlying implementation of pidfds in the Linux kernel has changed over time:

CRIU automatically detects these kernel differences and handles both formats transparently, ensuring that pidfds are correctly identified and restored regardless of the host kernel version.

Current Limitations

See also