Linux Container Development
 help / color / mirror / Atom feed
* [PATCH] cgroup freezer: Update stale comments
@ 2009-05-30  0:18 Matt Helsley
  0 siblings, 0 replies; only message in thread
From: Matt Helsley @ 2009-05-30  0:18 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA; +Cc: Paul Menage

Update stale comments regarding locking order and add a little more detail
so it's easier to follow the locking between the cgroup freezer and the
power management freezer code.

Signed-off-by: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index fb249e2..c2bb4aa 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -87,8 +87,8 @@ struct cgroup_subsys freezer_subsys;
  * ------------------------------
  * css_set_lock
  * cgroup_mutex (AKA cgroup_lock)
- * task->alloc_lock (AKA task_lock)
  * freezer->lock
+ * task->alloc_lock (AKA task_lock)
  * task->sighand->siglock
  *
  * cgroup code forces css_set_lock to be taken before task->alloc_lock
@@ -103,7 +103,6 @@ struct cgroup_subsys freezer_subsys;
  * task->alloc_lock (to get task's cgroup)
  *
  * freezer_fork() (preserving fork() performance means can't take cgroup_mutex):
- * task->alloc_lock (to get task's cgroup)
  * freezer->lock
  *  sighand->siglock (if the cgroup is freezing)
  *
@@ -116,13 +115,13 @@ struct cgroup_subsys freezer_subsys;
  * cgroup_mutex
  *  freezer->lock
  *   read_lock css_set_lock (cgroup iterator start)
- *    sighand->siglock
+ *    sighand->siglock (fake signal delivery inside freeze_task())
  *
  * freezer_write() (unfreeze):
  * cgroup_mutex
  *  freezer->lock
  *   read_lock css_set_lock (cgroup iterator start)
- *    task->alloc_lock (to prevent races with freeze_task())
+ *    task->alloc_lock (inside thaw_process(), prevents race with refrigerator())
  *     sighand->siglock
  */
 static struct cgroup_subsys_state *freezer_create(struct cgroup_subsys *ss,

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-30  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-30  0:18 [PATCH] cgroup freezer: Update stale comments Matt Helsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox