From 9a0184b10f474ba7e467581faecc34ce4ad9dfde Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Wed, 5 Feb 2020 09:32:21 +0000 Subject: [PATCH] cgroup2: use CRIU's new freezer v2 support The newest CRIU version supports freezer v2 and this tells runc to use it if new enough or fall back to non-freezer based process freezing on cgroup v2 system. Signed-off-by: Adrian Reber --- libcontainer/container_linux.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index b7c9173e..70284080 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -1015,9 +1015,14 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error { } } - fcg := c.cgroupManager.GetPaths()["freezer"] - if fcg != "" { - rpcOpts.FreezeCgroup = proto.String(fcg) + if !cgroups.IsCgroup2UnifiedMode() && c.checkCriuVersion(31400) == nil { + // CRIU currently cannot handle the v2 freezer correctly + // before release 3.14. For older releases we are telling + // CRIU to not use the cgroup v2 freezer. CRIU will pause + // each process manually using ptrace(). + if fcg := c.cgroupManager.GetPaths()["freezer"]; fcg != "" { + rpcOpts.FreezeCgroup = proto.String(fcg) + } } // append optional criu opts, e.g., page-server and port