criu

vDSO and VVAR Handling

The vDSO (virtual Dynamic Shared Object) and VVAR (virtual VARiable) areas are specialized memory regions mapped by the Linux kernel into every process. They enable high-performance userspace execution of specific system calls (such as gettimeofday() or clock_gettime()) by providing direct access to kernel-maintained code and data without the overhead of a full context switch.

The Challenge of C/R

The vDSO is uniquely challenging for checkpoint/restore because its contents and memory layout are determined by the host kernel.

  1. Address Dependencies: Applications frequently cache the addresses of vDSO functions. These must remain identical after restoration.
  2. ABI and Kernel Compatibility: If a process is migrated to a different kernel version, the vDSO code from the original host might be incompatible with the new host’s internal kernel-to-userspace data interfaces.

CRIU’s Restoration Strategy

CRIU uses two primary strategies to handle vDSO migration, automatically selecting the best one based on kernel capabilities detected during the Kerndat phase.

1. The Proxy (Patching) Method

This is the fallback approach used when the kernel does not support mapping the vDSO at an arbitrary address:

2. The arch_prctl Method (Modern)

On modern kernels (v4.18+ for x86_64), CRIU uses a significantly more efficient mechanism:

VVAR Handling

The VVAR area contains the raw data (such as the current clock value) that the vDSO code reads.

See also