Skip to content

Commit 89b73a7

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 ea51324 commit 89b73a7

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
@@ -675,6 +675,11 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
675675
OrphanPtsMaster: proto.Bool(true),
676676
}
677677

678+
fcg := c.cgroupManager.GetPaths()["freezer"]
679+
if fcg != "" {
680+
rpcOpts.FreezeCgroup = proto.String(fcg)
681+
}
682+
678683
// append optional criu opts, e.g., page-server and port
679684
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
680685
rpcOpts.Ps = &criurpc.CriuPageServerInfo{

0 commit comments

Comments
 (0)