[Devel] Re: [PATCH 4/4] cgroup freezer: --- replacement patch 4/4 (a)
Serge E. Hallyn
serue at us.ibm.com
Thu Jun 4 07:32:29 PDT 2009
Quoting Oren Laadan (orenl at cs.columbia.edu):
>
> >From 6cdb7d9504a19ad88e6da8ad85374267c7acb1b2 Mon Sep 17 00:00:00 2001
> From: Matt Helsley <matthltc at us.ibm.com>
> 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 at cs.columbia.edu>
> Cc: Matt Helsley <matthltc at us.ibm.com>
> Cc: Paul Menage <menage at google.com>
> Cc: Li Zefan <lizf at cn.fujitsu.com>
> Cc: Cedric Le Goater <legoater at free.fr>
Looks good -
Acked-by: Serge Hallyn <serue at us.ibm.com>
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 at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list