Skip to content

Commit 7325881

Browse files
committed
cr: set a freezer cgroup for criu
A freezer cgroup allows to dump processes faster. If a user wants to checkpoint a container and its storage, he has to pause a container, but in this case we need to pass a path to its freezer cgroup to "criu dump". Signed-off-by: Andrei Vagin <[email protected]>
1 parent fe03957 commit 7325881

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libcontainer/container_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,11 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
747747
OrphanPtsMaster: proto.Bool(true),
748748
}
749749

750+
fcg := c.cgroupManager.GetPaths()["freezer"]
751+
if fcg != "" {
752+
rpcOpts.FreezeCgroup = proto.String(fcg)
753+
}
754+
750755
// append optional criu opts, e.g., page-server and port
751756
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
752757
rpcOpts.Ps = &criurpc.CriuPageServerInfo{

0 commit comments

Comments
 (0)