Linux kernel

Revision as of 08:54, 20 April 2021 by Amikhalitsyn (talk | contribs) (added CONFIG_SYSVIPC_SYSCTL)

Most likely the first thing to enable is the CONFIG_EXPERT=y (General setup -> Configure standard kernel features (expert users)) option, which on x86_64 depends on the CONFIG_EMBEDDED=y (General setup -> Embedded system) one (welcome to Kconfig reverse chains hell).

The following options must be enabled for CRIU to work:

  • General setup options
    • CONFIG_CHECKPOINT_RESTORE=y (Checkpoint/restore support)
    • CONFIG_NAMESPACES=y (Namespaces support)
    • CONFIG_UTS_NS=y (Namespaces support -> UTS namespace)
    • CONFIG_IPC_NS=y (Namespaces support -> IPC namespace)
    • CONFIG_SYSVIPC_SYSCTL
    • CONFIG_PID_NS=y (Namespaces support -> PID namespaces)
    • CONFIG_NET_NS=y (Namespaces support -> Network namespace)
    • CONFIG_FHANDLE=y (Open by fhandle syscalls)
    • CONFIG_EVENTFD=y (Enable eventfd() system call)
    • CONFIG_EPOLL=y (Enable eventpoll support)
  • Networking support -> Networking options options for sock-diag subsystem
    • CONFIG_UNIX_DIAG=y (Unix domain sockets -> UNIX: socket monitoring interface)
    • CONFIG_INET_DIAG=y (TCP/IP networking -> INET: socket monitoring interface)
    • CONFIG_INET_UDP_DIAG=y (TCP/IP networking -> INET: socket monitoring interface -> UDP: socket monitoring interface)
    • CONFIG_PACKET_DIAG=y (Packet socket -> Packet: sockets monitoring interface)
    • CONFIG_NETLINK_DIAG=y (Netlink socket -> Netlink: sockets monitoring interface)
  • CONFIG_NETFILTER_XT_MARK=y (Networking support -> Networking options -> Network packet filtering framework (Netfilter) -> Core Netfilter Configuration -> Netfilter Xtables support (required for ip_tables) -> nfmark target and match support)
  • CONFIG_TUN=y (Networking support -> Universal TUN/TAP device driver support)


Other options not required by CRIU, but C/R supported (ZDTM test suite may fail without them):

  • CONFIG_INOTIFY_USER=y (File systems -> Inotify support for userspace)
  • CONFIG_FANOTIFY=y (File systems -> Filesystem wide access notification)
  • CONFIG_MEMCG=y (General setup -> Control Group support -> Memory controller)
  • CONFIG_CGROUP_DEVICE=y (General setup -> Control Group support -> Device controller)
  • CONFIG_MACVLAN=y (Device Drivers -> Network device support -> Network core driver support -> MAC-VLAN support)
  • CONFIG_BRIDGE=y (Networking support -> Networking options -> 802.1d Ethernet Bridging)
  • CONFIG_BINFMT_MISC=y (Userspace binary formats -> Kernel support for MISC binaries)
  • CONFIG_IA32_EMULATION=y (x86 only) (Executable file formats -> Emulations -> IA32 Emulation)

For some usage scenarios there is an ability to track memory changes and produce incremental dumps. Need to enable the CONFIG_MEM_SOFT_DIRTY=y (optional) (Processor type and features -> Track memory changes). In order to enable lazy migration, the userfaultfd system call is required CONFIG_USERFAULTFD=y (optional) (General setup -> Enable userfaultfd() system call).

In the beginning of the project we had our custom kernel, which contained some experimental CRIU related patches. Nowadays this is almost not used.