Quoting Oren Laadan (orenl@xxxxxxxxxxxxxxx): > > >From 6cdb7d9504a19ad88e6da8ad85374267c7acb1b2 Mon Sep 17 00:00:00 2001 > From: Matt Helsley <matthltc@xxxxxxxxxx> > Date: Wed, 3 Jun 2009 02:31:21 -0700 > Subject: [PATCH] cgroup freezer: Add CHECKPOINTING state to safeguard container checkpoint > > The CHECKPOINTING state prevents userspace from unfreezing tasks until > sys_checkpoint() is finished. When doing container checkpoint userspace > will do: > > echo FROZEN > /cgroups/my_container/freezer.state > ... > rc = sys_checkpoint( <pid of container root> ); > > To ensure a consistent checkpoint image userspace should not be allowed > to thaw the cgroup (echo THAWED > /cgroups/my_container/freezer.state) > during checkpoint. > > "CHECKPOINTING" can only be set on a "FROZEN" cgroup using the checkpoint > system call. Once in the "CHECKPOINTING" state, the cgroup may not leave until > the checkpoint system call is finished and ready to return. Then the > freezer state returns to "FROZEN". Writing any new state to freezer.state while > checkpointing will return EBUSY. These semantics ensure that userspace cannot > unfreeze the cgroup midway through the checkpoint system call. > > The cgroup_freezer_begin_checkpoint() and cgroup_freezer_end_checkpoint() > make relatively few assumptions about the task that is passed in. However the > way they are called in do_checkpoint() assumes that the root of the container > is in the same freezer cgroup as all the other tasks that will be > checkpointed. > > Matt Helsley's wrote the original patch. > > Changlog: > [2009-Jun-03] change cgroup_freezer_{begin,end}_checkpoint() to take a > struct cgroup_subsys_state pointer > add struct cgroup_subsys_state *get_task_cgroup_freezer() > > Signed-off-by: Oren Laadan <orenl@xxxxxxxxxxxxxxx> > Cc: Matt Helsley <matthltc@xxxxxxxxxx> > Cc: Paul Menage <menage@xxxxxxxxxx> > Cc: Li Zefan <lizf@xxxxxxxxxxxxxx> > Cc: Cedric Le Goater <legoater@xxxxxxx> Looks good - Acked-by: Serge Hallyn <serue@xxxxxxxxxx> to both. I still don't see why you need a ref to the root_freezer, but it doesn't hurt at any rate so I won't harp on it. thanks, -serge _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers